Re: bug, querk, or mistake?
| From: | CC Zona | Date: | Sat, 21 Apr 2001 19:29:49 +0000 |
| Subject: | Re: bug, querk, or mistake? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-49698@lists.php.net to get a copy of this message | ||
In article <NEBBICBJKLMEHPABOPJNAEEKDBAA.adamcharnock@btinternet.com>,
adamcharnock@btinternet.com ("Adam Charnock") wrote:
> The following if statement always claims to be false.
> However, I print out the variables in the if (which are strings) and they
> are identical. Here it is:
>
> if($reqcat["indexname"] == $row["maincat"])
It would help to know what the values of those variables are when the
comparison seemingly fails. With PHP's loose typing, it's possible for
variables that a human reader would consider clearly same/different to get
"unexpected" (though technically quite correct) results with a ==
comparison. You might try testing with the === operator (meaning, "values
*and* types equal") to eliminate a type casting issue as the culprit.
--
CC