how to check if a value is null in php code example Example 1: php null <?php $var = NULL; ?> Example 2: null condition in php is_null (var_name)