
Understanding NULL in PHP: Handling Absence of Value
☰Fullscreen
Null is a special data type which can have only one value: NULL.
A variable of data type NULL is a variable that has no value assigned to it.
Tip: If a variable is created without a value, it is automatically assigned a value of NULL.
Variables can also be emptied by setting the value to NULL:
Syntax:
<?php $x = "Hello world!"; $x = null; var_dump($x); ?>
No Questions Data Available.
No Program Data.