If the data is present, the system will completely output ‘boy@163.com’. If it is in the wrong format, such as 'boy', false will be output. If the email field in the form is not filled in, the system outputs null, which is empty.
<ol class="dp-xml"><li class="alt"><span><span>echo filter_input(INPUT_POST, <br>‘email’, FILTER_VALIDATE_EMAIL); </span></span></li></ol>
The fourth, PHP filter filters the content of the input variables according to the requirements
The only difference from the above is the second one If you use FILTER_SANITIZE_EMAIL as the parameter, the output results will be different. Suppose a field email comes through POST of the form.
If it is data similar to 'boy@163.com', the system will completely output 'boy@163.com'. If it is in the wrong format, such as 'boy-afds3', as long as it is numbers, letters, dashes and other content that can appear in the email format, the system will also completely output 'boy-afds3'. If the email field in the form is not filled in, the system outputs null, which is empty. If it is 'boy Asan', the system will remove the things that are not allowed in the email format and output 'boy'.
<ol class="dp-xml"><li class="alt"><span><span>echo filter_input<br>(INPUT_POST, ‘email’, <br>FILTER_SANITIZE_EMAIL); </span></span></li></ol>
The above is an introduction to the specific functions of PHP filter. I hope it will be helpful to friends who need it again.