Home >Backend Development >PHP Tutorial >A table to clarify the difference between php is_null, empty and isset, is_nullisset_PHP tutorial
isset determines whether the variable already exists
empty determines whether the variable is empty or 0
is_null determines whether the variable is NULL
变量 | 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 |