Re: Odd Code Error.

From: Date: Tue, 20 Jan 2004 23:30:51 +0000
Subject: Re: Odd Code Error.
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-175241@lists.php.net to get a copy of this message
On Tue, 2004-01-20 at 16:13, daniel@electroteque.org wrote: > > 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 ? I would recommend using it whenever you can. It may require a few extra lines of code here and there, but you know for sure what 'type' you are dealing with. This is especially good when dealing with user input. - Brad

« previous php.general (#175241) next »