标签:-- cal filter enc private lte code php pre
/**
* 过滤特殊字符
* @param unknown $str
*/
private function filterStr($str)
{
if($str){
$name = $str;
$name = preg_replace_callback(‘/\xEE[\x80-\xBF][\x80-\xBF]|\xEF[\x81-\x83][\x80-\xBF]/‘,function ($matches) { return ‘‘;}, $name);
$name = preg_replace_callback(‘/xE0[x80-x9F][x80-xBF]‘.‘|xED[xA0-xBF][x80-xBF]/S‘,function ($matches) { return ‘‘;}, $name);
$name = json_encode($name);
$name = preg_replace_callback("/\\\ud[0-9a-f]{3}/i", function ($matches) { return ‘‘;}, $name);
if(!empty($name))
{
$name = json_decode($name);
return $name;
}else{
return ‘‘;
}
}else{
return ‘‘;
}
}
标签:-- cal filter enc private lte code php pre
原文地址:http://www.cnblogs.com/xiaojiugui/p/7290444.html