note 24493 added to function.is-null

From: Date: Mon, 19 Aug 2002 14:43:08 +0000
Subject: note 24493 added to function.is-null
Groups: php.notes 
Request: Send a blank email to php-notes+get-35195@lists.php.net to get a copy of this message
The following function is useful for set a variable to a default value the case it contains null: function Nz($TestVar,$ValueIfNull) { if (is_null($TestVar)) return $ValueIfNull; else return $TestVar; } I have used it to ensure to always write something in the cells of a table; otherwise Netscape doesn't show the color of cell background. Ex: <TD valign="top" BGCOLOR="#F0F0F0"> <?echo Nz($row2["Name"],"&nbsp;");?> </TD> -- http://www.php.net/manual/en/function.is-null.php http://master.php.net/manage/user-notes.php?action=edit+24493 http://master.php.net/manage/user-notes.php?action=delete+24493 http://master.php.net/manage/user-notes.php?action=reject+24493

« previous php.notes (#35195) next »