PHP Tutorial Tutorials - PHP NULL Data type

PHP NULL Data type

The special Data type NULL represents a variable with no value.
NULL is the only possible value of type null.

<?php
// A variable is considered to be null if it has not been set to any value yet. 
// When a variable is declared; it is automatically assigned a value of null.
$a;
var_dump($a);
echo "<br>";

// A variable is considered to be null if it has been assigned the constant NULL. 
$b = NULL;
var_dump($b);
echo "<br>";
 
// A variable is considered to be null if it has been unset(). 
$c = "Hello World!";
unset($c);
var_dump($c);
?>

Output:

NULL
NULL
NULL
Date:2019-10-01 01:03:23 From:www.Lautturi.com author:Lautturi