Ask: Questions about filter function

Source: Internet
Author: User
Ask: questions about filter functions
Hello everyone:
About Filter function I think the official information is not very clear, special to ask you:
Filter_sanitize_string This filter "remove tags, remove or encode special characters" specifically what special characters ah? Which special characters are removed, and which are encoded? Who has specific information about this?
------Solution--------------------
Mysql_real_escape
------Solution--------------------
References:
I want to filter the user's input, 1. Remove letters, numbers, and other characters from Chinese characters. 2. Anti-SQL injection. Is there an existing filter function available in PHP?

achieved 1, the implementation of 2.
Assume that you are using UTF-8 encoding
$text = preg_replace ('/\w/u ', ' ', $text);
  • 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.