PHP Array Exercises : Search a specified value within the values of an associative array
33. Search Value Within Associative Array
Write a PHP function to search a specified value within the values of an associative array.
Sample Solution:
PHP Code:
Output:
Math has not found in part1 Math has not found in part2 Math has found in part3
Flowchart:

For more Practice: Solve these Related Problems:
- Write a PHP function to search for a specified value in an associative array and return the corresponding key if found.
- Write a PHP script to iterate over an associative array and output a message if the specified value is present.
- Write a PHP program to use array_search() to look up a value in an associative array and then display its key.
- Write a PHP script to implement a case-insensitive search for a value in an associative array and return the result.
Go to:
PREV : Get File Extension.
NEXT : Sort Associative Array (Case-Sensitive by Values).
PHP Code Editor:
Contribute your code and comments through Disqus.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.