Re: Re[2]: [PHP] Validating form field text input to be a specificvariable type
| From: | William Lovaton | Date: | Wed, 07 Apr 2004 13:49:00 +0000 |
| Subject: | Re: Re[2]: [PHP] Validating form field text input to be a specificvariable type | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-182626@lists.php.net to get a copy of this message | ||
Hi,
El mi? 07-04-2004 a las 08:38, Richard Davey escribió:
> Hello John,
>
> Wednesday, April 7, 2004, 2:05:22 PM, you wrote:
>
> JWH> Yeah, but the OP wanted to be able to tell an integer from a real number
> JWH> from a string. is_numeric() is going to validate 5, 5.5, and 5.05E6, for
> JWH> example.
>
> What about is_integer() ?
No way, it checks for data types too and it won't match because the data
in the $_REQUEST is always a string.
is_integer("5") will always be false.
is_integer(5) will return true
-William