Re: is_null
| From: | Plutarck | Date: | Fri, 13 Apr 2001 02:52:41 +0000 |
| Subject: | Re: is_null | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-48398@lists.php.net to get a copy of this message | ||
It doesn't tell you if a variable is actually null, but unless you
specifically need to know if it is actually "NULL", just testing for truth
is usually enough.
For most uses it works fine, but if you really need to know wether or not
it's null, take one of the other suggestions.
For instance, if you need to see if someone submitted something to the
$username variable, use:
if ($username)
{
// stuff
}
--
Plutarck
Should be working on something...
...but forgot what it was.
"Jennifer" <toxlists@canada.com> wrote in message
news:3AD636CB.8D39C4F5@canada.com...
> I wanted to use is_null, but it isn't available in my version
> (4.0B2)
>
> What would be an equivalent? I'm fairly new to PHP.
>
> I was using isset, but sometimes it is set to Null.
>
> Null values are unacceptable, but zero is a perfectly acceptable
> value for what I want.
>
> Jennifer
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>