Re: gettype() returning string instead of integer
| From: | Ignacio Vazquez-Abrams | Date: | Wed, 13 Dec 2000 22:26:41 +0000 |
| Subject: | Re: gettype() returning string instead of integer | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-30190@lists.php.net to get a copy of this message | ||
On Wed, 13 Dec 2000, Brian Curtis wrote:
> OK then, on to my next question. Anyone have a quick,
> off-the-top-of-their-head solution to check that a value passed using GET
> is_type() "x"?
>
>
> Thanks again,
>
> --
> Brian Curtis
>
How about something like !ereg("[^[:digit:]]", $var) or its preg
equivalent? It wouldn't work for values that should be strings but are all
digits, but it beats nothing (although not by much :) ).
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>