PHP NULL Value


Null is a special data type which can have only one value, which is itself. Which is to say, null is not only a data type, but also a keyword.


A variable of data type null is a variable that has no value assigned to it.

When a variable is created without a value, it is automatically assigned a value of null.

Example : 

<?php
$x="Hello world!";
$x=null;
var_dump($x);
?>

Comments