What is the difference between empty and non-take? In the normal programming process, I found that empty is basically the same as the non-variable. For example, & nbsp; $ a = 0 & nbsp; empty ($ a) and! $ A is the same, and this $ a, whether it is a null string, string 0, & nbsp; number 0, & nbsp; Boolean false, & nbsp; null & nbsp ;, they are basically the same. What is the difference between empty and non-empty?
In the normal programming process, I found that empty is basically the same as the non-variable.
For example, $ a = 0 empty ($ a) and! $ A is the same
And this $ a, whether it is a null string, string 0, number 0, Boolean false, null, basically the same.
Anything that does not belong to the above content can be processed as a true value in the condition.
So I don't know, if (empty ($ a) and if (! $ A) is it common?
If ($ a) and if (! Can empty ($ a) be used universally?
------ Solution --------------------
If empty is used, it doesn't matter if your changes are not fixed, but if it is used! If it is not, the variable volume cannot be modified.
You just need to look at the two generations in the next generation.
Var_dump (empty ($ ));
Var_dump (! $ );
------ Solution --------------------
223494678
This is my QQ group. if you are interested, you can come and talk about it.
------ Solution --------------------
Http://php.net/manual/en/types.comparisons.php
Let's see the difference between empty and bool.
------ Solution --------------------
When Notice-level errors are blocked, the two are the same.
------ Solution --------------------
Check the instructions on empty on the official website.
If you are afraid of an error, you can use isset to test whether there is an error.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.