PHP function gettype()
Availability in PHP 4.0
Returns the type of the variable.
Parameters
| Parameter | Data type | Default value | Note |
|---|---|---|---|
$var |
mixed |
not | Variable to check |
Return values
string
Returns the type of the variable.
Returns one of the following:
booleanintegerdouble(for historical reasons,doubleis returned instead offloat, based on the C implementation of PHP, which usesdouble)stringarrayobjectresourceNULLunknown type(unknown type)