Understanding empty fucntion in PHP

Here is a quick tip:

empty and is_blank

empty

$var = 10;

// Evaluates to true because $var is empty
if (empty($var)) {
echo
'$var is either 0, empty, or not set at all';
}
?>


0 comments:

Post a Comment