<?php $string = 'Hello World!'; if(stristr($string, 'earth') === FALSE) { echo '"earth" not found in string'; } // 出力は "earth" not found in string となります ?>
例3 文字列以外の needle の指定
<?php $string = 'APPLE'; echo stristr($string, 97); // 97 = 小文字の a // 出力は APPLE となります ?>