A table to figure out the difference between PHP is_null, empty, Isset, Is_nullisset
Isset to determine if a variable already exists
Empty to determine if the variable is null or 0
Is_null to determine if a variable is null
variables |
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 |
http://www.bkjia.com/PHPjc/1028302.html www.bkjia.com true http://www.bkjia.com/PHPjc/1028302.html techarticle a table to figure out the differences between PHP is_null, empty, Isset, Is_nullisset isset to determine if the variable is empty or null to determine whether the variable is blank or 0 is_null to determine whether the variable is a nullable variable ...