PHP 判断字符串 是否 包含另一个字符串

1.stristr 忽略大小写

$string = 'Hello World!';
if(stristr($string, 'earth') === FALSE) {
echo '"earth" not found in string<br />';
}// 输出: "earth" not found in string
echo stristr($string, 'lo');  //输出 lo World!

 

posted @ 2013-07-22 13:48  群叔  阅读(245)  评论(0编辑  收藏  举报