Re: FILTER_VALIDATE_INT - newbie question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> How is 0342352 being assigned to the variable that you're filtering?
> If PHP thinks it's a string, then the filter will fail. If PHP thinks

Oops, potentially bad information there as well, sorry. In general, a
string representation of a decimal number /will/ pass
FILTER_VALIDATE_INT. But your particular string ("0342352") will only
fail FILTER_VALIDATE_INT in the filter's default configuration; set
the ALLOW_OCTAL flag and it will pass:

http://codepad.org/RNE5LZMr

You'll still end up with an unexpected value in your final variable, though.

Ben

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux