NULL is PHP data type which returns no value.
We can initialize variable with NULL value in php.
NULL is equal to zero. So variable assigned with null returns 0 value.
Syntax:
<?php
$variable= NULL;
?>
NULL value is case-insensitive. So we can use null value for variable.
Look at below example. We have assigned value for $color variable is null. echo displays no value for $color variable.
Comments