Home  >  Article  >  Backend Development  >  PHP - the difference between isset and empty

PHP - the difference between isset and empty

WBOY
WBOYOriginal
2016-07-29 09:15:021002browse
转载请注明出处:http://blog.csdn.net/l1028386804/article/details/48595811

isset (variable) determines whether the variable exists, or whether the variable is null. If it exists, it is true, otherwise it is false.

empty (variable): Determine whether the content of the variable is empty (not null, but no content). Basically, it is some regulations. The following data are all "empty": 0, "", "0", false, null, array() empty array is also empty,

If the content of a variable is empty, the empty() result returns true, otherwise it returns false

The above has introduced the difference between isset and empty in PHP, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
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