Re: Please explain...
| From: | bvr | Date: | Tue, 19 Mar 2002 12:01:30 +0000 |
| Subject: | Re: Please explain... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-89105@lists.php.net to get a copy of this message | ||
This is because of type conversion, see also manual chapter 'Type juggling'.
"foo" converted to integer type is also zero, if you try "1foo" for example, it will convert to one.
if you want to check without type conversion use the === operator instead.
bvr.
Jan Rademaker wrote:
Can someone explain why this works? $x = 0; if ($x == "foo") { print "yeah"; } This prints 'yeah', but i can't figure out why...