PHP if not in string
This question already has an answer here:
I always use this:
if (stristr($string, "string")) {
//String exists within $string
}else{
//String does not exist
}
http://www.php.net/stristr
尝试这个:
if(strpos($string, 'String') !== false) {
//string exist
}
else{
//string not exist
}
链接地址: http://www.djcxy.com/p/13122.html
下一篇: PHP如果不在字符串中