strpos---查找字符串出现的位置
Example
// stripos() - 查找字符串首次出现的位置(不区分大小写)
// strrpos() - 查找字符串在目标字符串最后一次出现的位置
// strripos() - 查找字符串在目标字符串最后一次出现的位置(不区分大小写)
// strstr() - 查找字符串的首次出现
$mystring = 'chang';
$findme = 'a';
$pos = strpos($mystring, $findme); //int 2
// 注意这里使用的是 ===。简单的 == 不能像我们期待那样工作
if($pos === false) {
echo "The string {$findme} was not found in the string {$mystring}";
}else {
echo "The string {$findme} was found in the string {$mystring}";
echo " and exists at position {$pos}";
}