PHP array_search() functionThe array_search() function is an inbuilt function of PHP. It is used to search the array against the given value. The function returns the first corresponding key if successful. This function was introduced in PHP 4.0.5. SyntaxParameter
Return typeThe array_search() function returns the key of the corresponding value that is passed. If not found, FALSE is returned, and if there are more than one matches, the first matched key is returned. Example 1Output: 3 Example 2Output: a Example 3Output: b Example 4Output: 5
Next TopicPHP Array Functions
|