PHP Filter English punctuation and filter Chinese punctuation Code _php Tutorial

Source: Internet
Author: User
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] ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.