[php]stristr — strstr() 函數的忽略大小寫版本
官方範例
<?php
$email = 'USER@EXAMPLE.com';
echo stristr($email, 'e'); // 輸出 ER@EXAMPLE.com
echo stristr($email, 'e', true); // 自 PHP 5.3.0 起,輸出 US
?>
<?php
$string = 'Hello World!';
if(stristr($string, 'earth') === FALSE) {
echo '"earth" not found in string';
}
// 輸出: "earth" not found in string
?>
<?php
$string = 'APPLE';
echo stristr($string, 97); // 97 = 小寫字母 a
// 輸出: APPLE
?>
全站熱搜