PHPempty (), isset () and is_null () instance tests have been discussed a lot about the usage of PHP empty (), isset (), and is_null () functions, and a lot of information may not be clear. I will repeat it again here, but I should remember it more deeply, instead of simply using program examples to speak. The test type is as follows: PHP empty (), isset () and is_null () instance test
The usage of PHP empty (), isset (), and is_null () functions has been discussed a lot, and many materials may not be clear. I will repeat it again here, but I should remember it more deeply, instead of simply using program examples to speak.
The test type is as follows:
Empty ()
The first is the var_dump output of empty:
Program output:
The code shows that empty () outputs true if the data type is null or false.
Isset ()
Let's take a look at the output of isset:
We can see that isset () can only be used to determine whether it is NULL or not.
Is_null ()
Finally, the output of is_null is as follows:
Is_null.
It can be seen that empty () can be used to determine whether all data types are NULL or false, while is_null is basically the same as isset and can only be used to determine whether it is NULL or undefined.