note 121625 deleted from function.filter-var by cmb
| From: | cmb@php.net | Date: | Tue, 16 Oct 2018 10:04:53 +0000 |
| Subject: | note 121625 deleted from function.filter-var by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-209444@lists.php.net to get a copy of this message | ||
Note Submitter: hek
----
Html5 does have validation features for input fields. "require" attribute prevents of
submitting empty input. "pattern" attribute prevents of submitting incorrect data, using
regexp. "email" input type filters everything what is not correct email addres, etc.
So, instead of using php filter_var, now you can just use proper input type and proper attributes.
It will make your code more clear.
In addition, php runs on server side, so, it's not good idea to validate data using php(it will
take server computer resources). Much better is using javascript and html5 features for this purpose
and send to server computer only validated data.
thanks!