Re: difference between $foo and isset($foo)
| From: | Jim Winstead | Date: | Thu, 18 Apr 2002 18:58:17 +0000 |
| Subject: | Re: difference between $foo and isset($foo) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-93582@lists.php.net to get a copy of this message | ||
Norman Zhang <nzhang@arkon-group.com> wrote:
> Right? if ($foo) means variable exists and can be null. Whereas, isset($foo)
> means that the value in $foo cannot be null?
you've got it backwards. 'if (isset($foo))' tests that the variable has
been set to some value, possibly including false or null. 'if ($foo)'
tests that the value of the variable is true.
jim