note 28456 deleted from function.is-null by nlopess
| From: | nlopess@php.net | Date: | Tue, 03 Feb 2004 14:55:18 +0000 |
| Subject: | note 28456 deleted from function.is-null by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-64597@lists.php.net to get a copy of this message | ||
Note Submitter: minkyo@maru.jp
----
One of the ways to distinguish 0 from null in " ":
Since I was using PHP version under 4, I couldn't use "===" nor "is_null."
So, in order to exclude 0 from " " ...
if (($var == "") && ($var != "0"))
{
echo "Only cases of null go through here.";
}
I forgot to add a double quotation around 0 in the if condition and it failed to catch only the
cases of null. After adding the double quotation, it worked, but I still don't understand why
it needed to be "0" instead of simply 0.