Home > PHP > Function > Variable handling > gettype()

gettype()

gettype - Get the type of a variable

Syntax

string gettype (mixed $var)

Arguments

  • var - The variable being type checked.

Description

Returns the type of the PHP variable var.

Version

PHP 4, 5

Return value

Possibles values for the returned string are: " boolean " " integer " " double " (for historical reasons "double" is returned in case of a float, and not simply "float") " string " " array " " object " " resource " " NULL " "unknown type"