Search an array with duplicate value for the value 5 and return its key in PHP
Description
The following code shows how to search an array with duplicate value for the value 5 and return its key.
Example
/* www . jav a 2 s. co m*/
<?php
$a=array("a"=>"5","b"=>5,"c"=>"5");
echo array_search(5,$a,true);
?>
The code above generates the following result.