Null (NULL): A special data type in PHP that represents a null value, which means that no value is set for the variable null (null value) is case-insensitive, and null and NULL are the same.
There are three possible cases where a null value is assigned: There is no value assigned to it, null value is empty, and variables processed by the unset () function (Source: PHP from Beginner to Mastery) P47.
Examples are as follows:
The echo "variable ($string 1) is directly assigned null";
$string =null; $string 1 is assigned a null value
$string 3= "str"; $string 3 is assigned str
if (Is_null ($strig 1=null)) {//Determine if $string1 is empty
Echo ' String=null ';
}
Echo '
';
echo ' Variable ($string 2) is not assigned ';
if (Is_null ($string 2=null)) {//Determine if $string1 is empty
Echo ' String=null ';
}
Echo '
';
Echo ' was released by Unset ($string 3): ';
Unset ($string 3);
if (Is_null ($string 3=null)) {//Determine if $string1 is empty
Echo ' String=null ';
}
?>
Browser processing results:
Variable ($string 1) is directly assigned to Nullstring=null
Variable ($string 2) is not assigned String=null
Variable ($string 3) released by Unset (): String=null