PHP uses strpos or strstr to determine whether a character exists in a string

From http://blog.sina.com.cn/s/blog_8edc37a801016yha.html

if(strstr('12345','2') !== false){
	echo 'exists';
			}

or

if(strpos('12345','2') !== false){
	echo 'exists';
			}


Notice

yes !==false
not !=false

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326449292&siteId=291194637