← All built-ins / gettype()

gettype()

gettype(mixed $number): string

Parameters

NameTypeDescription
$vmixedvalue to inspect

Return value

Type name string: "int", "float", "string", "bool", "array", "null".

Example

echo gettype(1), " ", gettype(1.5), " ", gettype("x"), " ", gettype(true), " ", gettype([]), " ", gettype(null);
int float string bool array null

See also

is_int()var_dump()