note 30583 deleted from function.empty by sniper

From: Date: Sat, 23 Aug 2003 00:17:20 +0000
Subject: note 30583 deleted from function.empty by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-54906@lists.php.net to get a copy of this message
Note Submitter: rmorrow.NOSPAM@NOSPAM.neospire.net ---- I found empty() useful at the beginning of user defined functions, in which I check to make sure any necessary variables are present before going into any logic. This makes it easier for me to control some errors. function foo_bar($var1,$var2){ ...if (empty($var1) or empty($var2)){ ......echo "You must pass var1 and var2 to this function"; ......exit(); ...{ ...<other logic> } Seems to do the job :-)

« previous php.notes (#54906) next »