is_null, Empty, isset, unset Let's take a look at the descriptions of these 4 functions first.
Isset to determine if a variable already exists (config)
unset Delete (release) the variable
Empty to determine if the variable is null
Is_null to determine if a variable is null
OK, it's starting to get people. So start, these 4 functions in addition to unset, the other 3 is the judgment function, unset first out, because he will not be mistaken, followed by is_null, we can see it as!isset, is a reverse operation of isset, the following table can be very clear about their relationship:
Copy the Code code as follows:
Variable Empty is_null isset
$a = "" True false True
$a =null true True false
var $a true true false
$a =array () True false true
$a =false true false true
$a =15 false False true
$a =1 false False true
$a =0 true false true
$a = "0" true false true
$a = "true" false false true
$a = "false" false false true
From this we can find that as long as the variable is "" or 0, or false and null, as long as these values are empty will return true, and isset is to determine whether the variable exists, as long as you this variable is not NULL or unassigned, the return result is true, and Is_ Null is exactly the inverse of the isset.
Of course if only want to do the following work:
echo!isset ($_get[' a '); If you don't get the value of variable a
echo Empty ($_get[' a ']); If the value of variable A is empty
Then the results are the same and can all be used.
http://www.bkjia.com/PHPjc/326913.html www.bkjia.com true http://www.bkjia.com/PHPjc/326913.html techarticle is_null, Empty, isset, unset Let's take a look at the descriptions of these 4 functions first. Isset determine if the variable already exists (config) unset Delete (release) the variable to determine whether the variable is ...