Re: How to find if a string is an integer?
| From: | Alex Earl | Date: | Thu, 12 Jun 2003 19:22:41 +0000 |
| Subject: | Re: How to find if a string is an integer? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-151288@lists.php.net to get a copy of this message | ||
<snip>
> Sorry, I don´t know that you needed an effective snipet. And you are
> right,
> I only writed for positive integers. Try something like apply 2 type cast
> simunltaneous.
>
> if ( (string) ((int) $_POST["var_int"]) == $_POST["var_int"])
> echo "is int";
>
Why not just use the is_int() function?
www.php.net/is_int
Alex