我是非常新的PHP,我會知道php有函數來評估指定的Unicode字符存在於另一個字符串中。如何檢查是在PHP中的字符串中的unicode char
$str="Hello world";
echo *function*($str, "e") //print true
echo *function*($str, "y") //print false
我是非常新的PHP,我會知道php有函數來評估指定的Unicode字符存在於另一個字符串中。如何檢查是在PHP中的字符串中的unicode char
$str="Hello world";
echo *function*($str, "e") //print true
echo *function*($str, "y") //print false
嘗試mb_strpos()或mb_stripos() 看看http://www.php.net/manual/en/function.mb-stripos.php
例如使用strpos其中找到字符串中的字符串的第一個出現的位置
如果你需要多字節字符串 - 比如UTF-8 - 我建議使用mb_strpos代替:http://www.php.net/manual/en/function.mb-strpos.php – Marc