>>392
というわけで、
if (strpos($str, 'search') !== FALSE)
を使え。必ず「!== FALSE」にするように。理由は説明ダルいからマニュアル見れ。

>>389
$index = FALSE;
$word = '玉';

if ($ary = file('test.txt')) {
foreach ($ary as $key => $val) {
if (mb_stripos($val, $word) !== FALSE) {
$index = $key;
break;
}
}
}

var_dump($index);


strpos()はマルチバイト対応してないので、mb_系使うように。