PHP Filter English Punctuation mark filter Chinese punctuation code
Copy CodeThe code is as follows:
function Filter_mark ($text) {
if (Trim ($text) = = ") return";
$text =preg_replace ("/[[:p unct:]\s]/", ", $text);
$text =urlencode ($text);
$text =preg_replace ("/(%7e|%60|%21|%40|%23|%24|%25|%5e|%26|%27|%2a|%28|%29|%2b|%7c|%5c|%3d|\-|_|%5b|%5d|%7d|%7b |%3b|%22|%3a|%3f|%3e|%3c|%2c|\.| %2f|%a3%bf|%a1%b7|%a1%b6|%a1%a2|%a1%a3|%a3%ac|%7d|%a1%b0|%a3%ba|%a3%bb|%a1%ae|%a1%af|%a1%b1|%a3%fc|%a3%bd|%a1% aa|%a3%a9|%a3%a8|%a1%ad|%a3%a4|%a1%a4|%a3%a1|%e3%80%82|%ef%bc%81|%ef%bc%8c|%ef%bc%9b|%ef%bc%9f|%ef%bc%9a|%e3% 80%81|%e2%80%a6%e2%80%a6|%e2%80%9d|%e2%80%9c|%e2%80%98|%e2%80%99|%ef%bd%9e|%ef%bc%8e|%ef%bc%88) +/",", $text);
$text =urldecode ($text);
Return trim ($text);
}
http://www.bkjia.com/PHPjc/788626.html www.bkjia.com true http://www.bkjia.com/PHPjc/788626.html techarticle PHP Filter English punctuation mark filter Chinese punctuation Code copy Code code as follows: function Filter_mark ($text) {if ($text) = = ") return"; $text =preg_replace ("/ [[:p unct:]\s] ...