In the development process, often encountered in the judgment of the existence of variables and whether it is empty, especially the array, if the access to a non-existent element of the array, there will be a notice level of error burst, but also a logic is not rigorous performance.
First, look at the empty () function:
Determines whether a function is empty. So what is the case in PHP that is considered empty? The first is that the variable does not exist , and the second is that the value of this variable is equal to FALSE. That is, empty ($var) is equivalent to!isset ($var) | | $var = = FALSE.
Then look at the Isset () function:
Determine if a variable exists and his value is not equal to null.
If the unset ($var), the $var will not exist;
If a variable is given NULL, the function also returns FALSE;
And this function can have more than one parameter, which returns TRUE only if all arguments are present and the value is not equal to NULL.
Because NULL is also a value equivalent to a value of false, the emtpy () function equals isset () plus a value that determines whether the variable is equal to the other equivalent of false.