NULL (null): a special data type in PHP, indicating a null value, that is, no value is set for this variable. null (null) is case-insensitive. null and null are the same.
NULL values can be assigned in three situations: no value is assigned, null is assigned, and the variable is processed by the unset () function.(Source: PhP from entry to proficiency, p47.
The instance is as follows::
<? PHP
Echo "the value of variable ($ string1) is null ";
$ String = NULL; // $ string1 is assigned a null value.
$ String3 = "str"; // $ string3 is assigned Str
If (is_null ($ strig1 = NULL) {// judge whether $ string1 is null
Echo 'string = null ';
}
Echo '<p> ';
Echo 'variable ($ string2) not assigned ';
If (is_null ($ string2 = NULL) {// judge whether $ string1 is null
Echo 'string = null ';
}
Echo '<p> ';
Echo 'variable released by unset () ($ string3 ):';
Unset ($ string3 );
If (is_null ($ string3 = NULL) {// judge whether $ string1 is null
Echo 'string = null ';
}
?>
Browser processing result:
The variable ($ string1) is directly assigned nullstring = NULL.
Variable ($ string2) not assigned string = NULL
Variable released by unset () ($ string3): String = NULL