Entry
[+] gettype : Get the type of a variable
Dec 23rd, 2000 01:08
Philip Olson,
------------------------------------------------------------------------
Definition : Returns the type of the PHP variable var.
Possibles values for the returned string are:
"boolean" , "integer" , "double"
"string" , "array" , "object"
"resource" , "unknown type"
and depreciated type "user function" (PHP3 Only)
------------------------------------------------------------------------
Use : $foo = 9;
$bar = 'string';
$sky = array('sun','cloud','bird');
print gettype($foo); // prints 'integer'
print gettype($bar); // prints 'string'
print gettype($sky); // prints 'array'
------------------------------------------------------------------------
Related : Since gettype() deals with types, you should learn
types! In fact, you should learn about types anyways :-)
General Types :
http://www.php.net/manual/language.types.php
Type Juggling :
http://www.php.net/manual/language.types.type-juggling.php