note 100708 deleted from function.filter-var by salathe
| From: | salathe@php.net | Date: | Mon, 04 Apr 2011 14:46:08 +0000 |
| Subject: | note 100708 deleted from function.filter-var by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-178481@lists.php.net to get a copy of this message | ||
Note Submitter: Remon
Reason: in docs
----
Please note that filter flag FILTER_FLAG_SCHEME_REQUIRED from Example #1 is false!
The flag is not defined on and cannot be used.
Both examples below return false:
<?php
var_dump(filter_var('example.com', FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED));
var_dump(filter_var('example.com', FILTER_VALIDATE_URL));
?>
The source of filters shows that:
- It always returns false when the scheme is NULL.
- FILTER_FLAG_SCHEME_REQUIRED is not used there.
So be aware that example.com will never be validated.