Re: alternative to empty
| From: | Philip Hallstrom | Date: | Wed, 06 Jul 2005 16:14:35 +0000 |
| Subject: | Re: alternative to empty | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-218212@lists.php.net to get a copy of this message | ||
Careful... notice the differenec b/n == and ===.... <?php $s = 0; if ($s == '') {I have been using empty in forms for some time now. but have just discovered thatIf ($string == '') ??PHP 4 As of PHP 4, The string value "0" is considered empty.
print("==\n");
}
if ($s === '') {
print("===\n");
}
?>
% php foo.php
==
%