note 14863 deleted from language.operators.comparison by irc-html
| From: | irc-html@php.net | Date: | Sat, 19 Jan 2002 19:10:59 +0000 |
| Subject: | note 14863 deleted from language.operators.comparison by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-25228@lists.php.net to get a copy of this message | ||
Hi folks -- quick hack-fix:
Situation: you do a db query where the result can be either 0 or NULL (or some other value). You
want to test to see which is which. For whatever reason, you can't seem to get any equality
test to say that 0 is not equal to ''.
Don't sweat it: do a strlen() on the value. If it's 0, the strlen will be 1. If it's
'', the strlen will be 0.
Dirty little hack and all...