Re: gettype() returning string instead of integer

From: Date: Wed, 13 Dec 2000 21:08:31 +0000
Subject: Re: gettype() returning string instead of integer
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-30174@lists.php.net to get a copy of this message
On Wed, 13 Dec 2000, Brian Curtis wrote: > In the following situation, I'm finding that PHP4 (CGI) is returning > "string" instead of "integer": > > $myType = gettype($myVar); > echo "type is: $myType"; > > and calling the above code via: > > <A HREF="http://dom.ext/type.php?myVar=1"> > > results in "type is: string" no matter what's used in the URL. > > Should gettype() not return "integer" in the above situation? Am I missing > something? The docs didn't mention any gotcha's or notes. > > TIA, > > -- > Brian Curtis > There is one really big gotcha: HTTP doesn't allow differentiation between integers and strings in GET and POST, so everything is a string. -- Ignacio Vazquez-Abrams <ignacio@openservices.net>

« previous php.general (#30174) next »