Re: = 0 and = "0"
| From: | Robin Chen | Date: | Thu, 25 Oct 2001 09:02:14 +0000 |
| Subject: | Re: = 0 and = "0" | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-72221@lists.php.net to get a copy of this message | ||
The integer 0 is equal to False, but not Null.
Robin
Kodrik wrote:
>
> > > If you set $qty=0; then $qty has no value.
> >
> > Of course it has a value.
>
> No it doesn't have a value.
> PHP interprets 0 as null.
>
> A very easy way for you to check:
>
> $value=0;
>
> if(!$value) printf("$value doesn't have a value (it didn't even print
> 0)<br>\n");
>
> $value="0"
> if($value) printf("$value does have a value if I put "0" instead of
> 0<br>\n");
>
> --
> 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