The system will output 'Boy @ 163.com 'in full '. If the format is incorrect, for example, 'Boy ', false is output. If the email field is not filled in the form, the system outputs null, that is, null.
- Echo filter_input (INPUT_POST,
'Email ', FILTER_VALIDATE_EMAIL );
Fourth, PHP filter filters the content of input variables as required
The only difference is that the second parameter uses FILTER_SANITIZE_EMAIL and the output result is different. Assume that an email is sent from the form POST field.
If the data is similar to 'Boy @ 163.com ', the system will completely output 'Boy @ 163.com '. If the format is incorrect, for example, 'boy-afds3', as long as it is in the e-mail format such as numbers, letters, and dashes, the system also outputs 'boy-afds3' completely ′. If the email field is not filled in the form, the system outputs null, that is, null. If it is 'Boy a 3', the system will remove the content that is not allowed in the email format and output 'boys '.
- Echo filter_input
(INPUT_POST, 'email ',
FILTER_SANITIZE_EMAIL );
The above is the specific function introduction of PHP filter, and I hope it will be helpful to friends who need it.