Echo!isset (get[′a′]); If the value of variable A is not Echoempty (_get[' a ']); If the value of variable A is null Is_null, empty, isset, unset Let's take a look at the descriptions of these 4 functions first.
Isset determine if a variable already exists (configuration)
unset to remove (release) a variable
Empty determine if the variable is empty
Is_null determine if the variable is null
OK, it's starting to get people started. So start, the 4 functions except unset, the other 3 are the Judge function, unset first out, because he will not be mistaken, followed by is_null, we can see it as a!isset, is the isset of a reverse operation, the following table can be very clear description of their relationship:
variable empty is_null isset $a = "" True False true $a =null true true false Var $a
True true false $a =array () True to True $a =false true false $a =15 false F Alse true $a =1 false to true $a =0 True false $a = ' 0 ' true false True $a = "true" to false true $a = "false" false False true
From that we can see that as long as the variable is "" or 0, or false and null, as long as the value empty returns True, and Isset is the judge of whether the variable exists, as long as you are not NULL or unassigned, the return result is true, and Is_ Null is exactly the inverse result of isset.
Of course if just want to do the following work:
Echo!isset (get[′a′]); If the value of variable A is not Echoempty (_get[' a ']); If the value of variable A is empty
So the results are the same, they can be used.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/PHP/