Summary of isset(), isnull() and empty() in php

王林
Release: 2023-04-08 07:30:01
forward
2964 people have browsed it

Summary of isset(), isnull() and empty() in php

isset()Detects whether the variable is set and non-NULL.

empty()Checks whether a variable is empty.

The following things are considered empty.

Summary of isset(), isnull() and empty() in php

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.

Summary of isset(), isnull() and empty() in php

empty

Summary of isset(), isnull() and empty() in php

In addition, PHP7 has a quick way to judge which is??and ?: Grammar, you should pay more attention to this.

Summary of isset(), isnull() and empty() in php

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:

Summary of isset(), isnull() and empty() in php

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!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template