How to correctly use PHP filter to judge filtering Data _php Tutorial

Source: Internet
Author: User
In the data, the system will output ' boy@163.com ' completely. If it is in the wrong format, such as ' Boy ', it will output false. If you do not fill out the email field in the form, the system outputs null, which is empty.

 
  
  

Fourth, PHP filter filters the contents of the input variables as required

The only difference from the above is that the second parameter uses filter_sanitize_email, and the output will be different. Let's say you send a field via the form's post to email.

If the data is similar to ' boy@163.com ', the system will output ' boy@163.com ' completely. If it is the wrong format, such as ' boy-afds3′, as long as the numbers and letters and dashes and other email formats can appear, the system will also complete output ' boy-afds3′. If you do not fill out the email field in the form, the system outputs null, which is empty. If it is ' Boy three ', the system will be the email format is not allowed to remove things, output ' boy '.

 
  
  
  1. Echo Filter_input

    Filter_sanitize_email);

The above is the specific function of PHP filter, I hope that the need for a friend to help.


http://www.bkjia.com/PHPjc/446194.html www.bkjia.com true http://www.bkjia.com/PHPjc/446194.html techarticle in the data, the system will complete the output boy@163.com. If it is in the wrong format, such as boy, it will output false. If you do not fill out the email field in the form, the system outputs NULL, ...

  • 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.