There are two ways to use the string search functions strstr() and strpos()
strstr() function -> Find the first occurrence of the specified string and return the remaining part of the string:
strpos() function -> Find the first occurrence of the specified string (starting from 0)
It is recommended here to use the strpos() function, which is faster and consumes less memory (case-sensitive, use stripos() if case-insensitive)
$str = 'hello china ~';
$checkstr = 'hello';
if (strpos($str, $checkstr) !== false) {
die('恭喜你查询到了');
}else{
die('查询不到');
}