note 18770 deleted from function.empty by sniper

From: Date: Sat, 23 Aug 2003 00:20:48 +0000
Subject: note 18770 deleted from function.empty by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-54915@lists.php.net to get a copy of this message
Note Submitter: scott at mha.ca ---- if you are wanting to know if a string is set and is not null, you would be best to use strlen() instead of empty() to avoid the typemorph nonsense (in particular, "0" == false) while still preserving efficiency and logical presentation, i.e.: if (strlen($string)) { echo "string was set to ".$string; } else { echo "string was not set"; }

« previous php.notes (#54915) next »