note 118846 deleted from filter.filters.validate by salathe
| From: | salathe@php.net | Date: | Tue, 16 Feb 2016 12:44:43 +0000 |
| Subject: | note 118846 deleted from filter.filters.validate by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-204958@lists.php.net to get a copy of this message | ||
Note Submitter: rihoj
----
The following code posted originally by Inigo has an issue with it.
echo filter_var(5, FILTER_VALIDATE_INT,array("options"
=>array('min_range'=>0,'max_range'=>4))) ? 'true'
:'false';
Because 0 is within the valid range, filter_var will return 0, but because of the Ternary operation
it will return false indicating it is not within the range when it is.