php condition for db null check code example Example 1: php check for null is_null($foo) Example 2: php null <?php $var = NULL; ?>