PHP isset vs empty vs is_null
Value of variable ($var)if($var)issetemptyis_null
$var=1;truetruefalsefalse
$var="php";truetruefalsefalse
$var=" "; (space)truetruefalsefalse
$var=TRUE;truetruefalsefalse
$var=0;falsetruetruefalse
$var=0.0;falsetruetruefalse
$var="0";falsetruetruefalse
$var=""; (an empty string)falsetruetruefalse
$var=FALSE;falsetruetruefalse
$var=NULL;falsefalsetruetrue
$var (a variable declared, but without a value)*false*falsetrue*true*
undefined*false*falsetrue*true*
$var=array(1);truetruefalsefalse
$var=array(); (an empty array)falsetruetruefalse

* "Notice: Undefined variable: ..." also occurs.