The empty () function is used to determine whether a string is empty
As long as the variable is 0,null, ", False,empty () is judged to be true.
$num 1= '; $num 2=0; echo $num 1== $num 2; Echo '
'; echo $num 1=== $num 2? ' 1 ': ' 0 ';
The result is:
The reason is that in PHP variables are stored in the structure of the C language, empty strings and null,false are stored with a value of 0, where the struct has a zend_uchartype, such a member variable, which is used to hold the type of the variable, and the type of the empty string is a string, The type of NULL is Null,false is Boolean. the = = = Operator Not only compares values, but also compares types.
Judging the empty string and 0 can do this:
$num 1= '; $num 2=0; if (Empty ($num 1) && $num 1=== ") { echo" true "; } if (Empty ($num 2) && $num 2===0) { echo ' true '; }
The result is:
The above describes the PHP null,0,,false differences, including the false,null aspects of the content, I hope the PHP tutorial interested in a friend helpful.