[snip]
> Interesting. I wouldn't have expected that. However, that is how it
> should work. Check out table K-2 on this page:
>
> http://us4.php.net/manual/en/types.comparisons.php
>
> '==' is a loose comparison. You can use '===' instead which will give
> you the results you are looking for.
>
> if ($EA === "NFH")
>
Hmm after all this time, are you saying its best to use === instead of
==
in any application ?
[/snip]
For strings, yes. And you should also re-order the question ...
if("NFH" === $EA)
Why, you ask? Because this will prevent possible assignment errors. If
you accidentally type
if($EA = "NFH")
NFH gets assigned to $EA and is true...you might not see the error until
quite a bit later. However if you accidentally type
if("NFH" = $EA)
an error will get thrown right away.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php