Re: testing filter ext in RC1
| From: | Pierre | Date: | Fri, 28 Jul 2006 16:43:38 +0000 |
| Subject: | Re: testing filter ext in RC1 | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-25041@lists.php.net to get a copy of this message | ||
On 7/28/06, Kevin Waterson <kevin@oceania.net> wrote:
This one time, at band camp, Pierre <pierre.php@gmail.com> wrote:Please show me some code, "here" is not really helpful. For example: $ php -r '$var=1234; var_dump(filter_data($var, FILTER_VALIDATE_INT));' int(1234) $ php -r '$var=ab1234; var_dump(filter_data($var, FILTER_VALIDATE_INT));' bool(false) --Pierreif var was abc1234 then it would return NULL, is that correct?False if the value is not valid, null if the value does not exist (for example with input_get or input_get_args). In the case of filter_data, as you pass the variable, it will be either false or the correct value. here it returns '0'