过滤符号
/**
* 过滤符号
* $str 字符串
*/
function Guolv_1 ($str) {
$regex = "/\/|\~|\!|\@|\#|\\$|\%|\^|\&|\*|\(|\)|\_|\+|\{|\}|\:|\<|\>|\?|\[|\]|\,|\.|\/|\;|\'|\`|\-|\=|\\\|\|/";
return preg_replace($regex,"",$str);
}
过滤某些词组
/**
* 过滤某些词组
* $str 字符串
*/
function guolv_2($str){
$str = str_replace(' ', '', $str);
$str = str_replace('”', '', $str);
$str = str_replace('“', '', $str);
$str = str_replace('…', '', $str);
return trim($str);
}