I am doing a very small online store application in PHP. So I have an array of maps in PHP. I want to search for a string (a product) in the array. I looked at array_search
I have same Issue but i have created i function to search in array by passing the array, key and value.
public function searchinarr($array, $key, $value) { $results = array(); for($i=0;$i$val) { if($k==$key) { if(strpos($val,$value)!== false) { $results[] = $array[$i]; } } } } return $results; }