$b = strtolower("bus"); for($j=0;$j<count($array);$j++){ if(preg_match("/$b/i",strtolower($array[$j]['valorBusqueda']))) { $coiciden[] = $j; } }