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