[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
?>

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 stockwfj3 的頭像
    stockwfj3

    程式設計@筆記

    stockwfj3 發表在 痞客邦 留言(0) 人氣()