<?PHP/** * When Var does not exist, returns true; * Returns True if Var is present and is a non-null nonzero value (truth). * The following things are considered empty: * * 1. "" (empty string) * 2.0 (as an integer of 0) * 3.0.0 (as a floating-point number of 0) * 4. " 0 "(as a string of 0) * 5.NULL * 6.FALSE * 7.array () (an empty array) * 8. $var; (a variable that declares, but has no value)*/$a;$b=NULL;$c= 0;$d= ' ';$e= ' abc ';Echo Empty($a)." -a<br> ";Echo Empty($b)." -b<br> ";Echo Empty($c)." -c<br> "; Echo Empty($d)." -d<br> "; Echo Empty($e)." -e<br> ";//empty () is null, the variable e has a true value, return false, no outputEcho Empty($f)." -f<br> ";Echo NULL." -null<br> ";Echo false." -false<br> ";Echo true." -true<br> ";if(Empty($e)){ Echo"Variable e is not present or has no truth";}Else{ Echo"Variable e has a truth value and \ $e = ' {$e}‘;";}/** Output: 1-a1-b1-c1-d-e1-f-null-false1-true variable E has a true value, and $e = ' abc ';*/
Empty () function Classic explanation