I have an array and I\'d like to search for the string \'green\'. So in this case it should return the $arr[2]
\'green\'
$arr[2]
$arr = array(0 =>
function check($string) { foreach($arr as $a) { if(strpos($a,$string) !== false) { return true; } } return false; }