isset()Detects whether the variable is set and non-NULL.
empty()Checks whether a variable is empty.
The following things are considered empty.
isnull()Detect whether the variable is NULL.
(Recommended learning video: php video tutorial)
Examples are as follows:
isset
Determine whether the variable is defined first, whether the key value of the array exists, etc.
empty
In addition, PHP7 has a quick way to judge which is??and ?: Grammar, you should pay more attention to this.
Through the above examples, you should understand the differences between these. As long as we pay more attention during development, we can choose the appropriate judgment function.
Conclusion:
Recommended related articles and tutorials: php tutorial
The above is the detailed content of Summary of isset(), isnull() and empty() in php. For more information, please follow other related articles on the PHP Chinese website!