3.0.0 - 普通 - 未处理
我检查字符串是否是UTF8编码,用了ThinkPHP\Extend\Function\extend.php里的function is_utf8($string)方法,使用不了。Load('extend');也使用了。后来在网上又找了个方法,使用正常。
//liulipeng add 判断字符编码
function is_utf8($liehuo_net){
if (preg_match("/^([".chr(228)."-".chr(233)."]{1}[".chr(128)."-".chr(191)."]{1}[".chr(128)."-".chr(191)."]{1}){1}/",$liehuo_net) == true || preg_match("/([".chr(228)."-".chr(233)."]{1}[".chr(128)."-".chr(191)."]{1}[".chr(128)."-".chr(191)."]{1}){1}$/",$liehuo_net) == true || preg_match("/([".chr(228)."-".chr(233)."]{1}[".chr(128)."-".chr(191)."]{1}[".chr(128)."-".chr(191)."]{1}){2,}/",$liehuo_net) == true){
return true;
}else{
return false;
}
} 