note 44447 added to function.empty

From: Date: Thu, 05 Aug 2004 21:21:45 +0000
Subject: note 44447 added to function.empty
Groups: php.notes 
Request: Send a blank email to php-notes+get-74089@lists.php.net to get a copy of this message
I tried this code (from below) if(empty($var) && $var!=0) but if $var isn't declared or $var='' then it doesn't pass this test and you won't get your error saying it is empty. I converted it to this and it works like a champ for me when I have fields that might have a zero in them. if(empty($var) && !is_numeric($var)) { echo "empty."; } ---- Manual Page -- http://www.php.net/manual/en/function.empty.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+44447 Delete -- http://master.php.net/manage/user-notes.php?action=delete+44447&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+44447&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#74089) next »