how to check if a value is not null php code example Example 1: php check for null is_null($foo) Example 2: null condition in php is_null (var_name)