Variable Handling Functions

Description

This PHP Variable Handling Functions category includes functions that operate on variables to perform operations such as dumping, displaying, testing, and changing data types.

The table below provides a list of the PHP functions in the Variable Handling category. Although the PHP Manual shows these functions as taking variables as arguments, most of them can take arbitrary expressions. The descriptions of the functions in the table indicate whether each takes a variable or an expression.

Function Description
boolval() Returns the Boolean value of an expression
debug_zval_dump() Dumps a string representation of an internal zend value to output
doubleval() Alias of floatval()
empty() Determines whether an expression is empty
floatval() Returns the float value of an expression
get_defined_vars() Returns an array of all defined variables
get_resource_type() Returns the type of a resource expression
gettype() Returns the type of an expression
intval() Returns the integer value of an expression
is_array() Determines whether an expression is an array
is_bool() Determines whether an expression is a boolean
is_callable() Verifies that an expression can be called as a function
is_double() Alias of is_float()
is_float() Determines whether the type of an expression is float
is_int() Determines whether the type of an expression is integer
is_integer() Alias of is_int()
is_long() Alias of is_int()
is_null() Determines whether an expression is NULL
is_numeric() Determines whether an expression is a number or a numeric string
is_object() Determines whether an expression is an object
is_real() Alias of is_float()
is_resource() Determines whether an expression is a resource
is_scalar() Determines whether an expression is a scalar
is_string() Determines whether an expression is a string
isset() Determines if a variable is set and is not NULL
print_r() Prints human-readable information about a variable
serialize() Generates a storable representation of a value
settype() Sets the type of a variable
strval() Returns the string value of an expression
unserialize() Creates a PHP value from a stored representation
unset() Unsets a given variable
var_dump() Dumps information about an expression
var_export() Outputs or returns a parsable string representation of a variable

References