Re: Re: Comparison Operator
| From: | John Nichel | Date: | Mon, 10 Jan 2005 19:59:51 +0000 |
| Subject: | Re: Re: Comparison Operator | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-206010@lists.php.net to get a copy of this message | ||
Jason Morehouse wrote:
Russell Chadwick wrote:If the comparison is false, the echo shouldn't be executed. This if statement is evaluating to true, because... "If you compare an integer with a string, the string is converted to a number." http://us4.php.net/manual/en/language.operators.comparison.php <snip> -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.comCould anyone tell me why this code echos? <?php $value = 0; $curval = 'A'; if ($value == $curval) { echo "WTH, Over<br>"; } ?>$value = 0 means false. And your comparison is false. Try: