FILTER_VALIDATE_INT - newbie question
| From: | MEM | Date: | Wed, 07 Oct 2009 09:57:31 +0000 |
| Subject: | FILTER_VALIDATE_INT - newbie question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-298714@lists.php.net to get a copy of this message | ||
Hello all,
I'm having this strange behavior, and I do not understanding why...
When I use FILTER_VALIDATE_INT I'm unable to get, on my input box, values
starting with 0(zero), or values that are greater (in length) then 10
digits.
I was expecting to be able to input the all range of integers.
I've tried this:
if (!filter_var($telefone, FILTER_VALIDATE_INT))
{
$erros['telefone'] = 'Invalid Teléfono - Only Numbers Allowed.';
}
And this:
if (!filter_var($telefone, FILTER_VALIDATE_INT, array("options" =>
array("min_range"=>-1, "max_range"=>9999999999999))))
{
$erros['telefone'] = 'Invalid Teléfono - Only Numbers Allowed.';
}
And this:
if (filter_var($telefone, FILTER_VALIDATE_INT, array("options" =>
array("min_range"=>0, "max_range"=>99999999999999999))) == false )
{
$erros['telefone'] = 'Invalid Teléfono - Only Numbers Allowed.';
}
No success. :s
What am I not getting?
Thanks,
Márcio
Ps- Anyone knows where can we grab a good source information about
FILTER_VALIDATE_INT specifically?