Sunday, September 6, 2009

PHP empty

The PHP empty function evaluates a variable ($var) and tests if it is empty. The function will return TRUE if $var has an empty or zero value.

PHP empty() considers the following to be empty or zero value

"", 0, "0", NULL, FALSE, array(), var $var;

Consider the following code:

$var = 0;
empty($var); // true
isset($var); // also true.

No comments:

Post a Comment