empty()

empty - Determine whether a variable is empty

Syntax

bool empty (mixed $var)

Arguments

  • var - Variable to be checked Note: empty() only checks variables as anything else will result in a parse error. In other words, the following will not work: empty(trim()). empty() is the opposite of (boolean) var, except that no warning is generated when the variable is not set.

Description

Determine whether a variable is considered to be empty.

Version

PHP 4, 5

Return value

Returns FALSE if var has a non-empty and non-zero value.