Re: extract($_POST)
| From: | Monty | Date: | Sat, 26 Oct 2002 21:59:01 +0000 |
| Subject: | Re: extract($_POST) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-121556@lists.php.net to get a copy of this message | ||
John W. Holmes wrote:
> Then make sure $id is a number. You can use is_int, or (int), or whatever.
It appears that any numeric values passed via the URL (..?param=10001) are
automatically treated as strings. If I pass ?param=1001 to the following
script...
$type = '';
if (is_string($param)) { $type = 'string'; }
if (is_int($param)) { $type = 'integer'; }
echo 'Type: '.$type;
... I get the following result:
Type: string
But, it should be integer because 10001 is meant to be a number. How does
this work for $_GET values?
Monty