PDA

View Full Version : <> operator?


sir pannels
03-19-2008, 05:05 PM
hi all

just quickly, what does <> do in if statements ? I cant find it on the php website

cheers

rafiki
03-19-2008, 05:08 PM
this page might help
http://www.w3schools.com/php/php_operators.asp

sir pannels
03-19-2008, 05:11 PM
ok so its not listed but < and > are listed seperately so I assume it means
IF greater than OR less than?

cheers for the link, btw

Andrew Johnson
03-19-2008, 05:25 PM
It means not equal to.

kbluhm
03-20-2008, 09:45 PM
Is it just me, or were there more replies in here?

CFMaBiSmAd
03-20-2008, 09:54 PM
You're correct and at least one of them was a link to the php.net manual page that does list it (the w3school site contains an incomplete list so is not as useful as the actual php manual would be since it is the source of all the basic php language information.)

kbluhm
03-20-2008, 11:21 PM
Good, I'm not crazy! I could have sworn I'd posted the link after Andrew schooled aedrin on the meaning of <>.

Here it is again:
http://www.php.net/operators.comparison

In my opinion, we should always reference php.net when referencing PHP. W3Schools can be handy, but I liken it to Yahoo! Sports trying to compete with MLB.com. You just can't beat the official source. :thumbsup:

rafiki
03-21-2008, 12:57 AM
i used it because it came up in a search of "PHP Operators" and the php site didn't :S

aedrin
03-21-2008, 07:56 PM
after Andrew schooled aedrin on the meaning of <>.


It probably got deleted after some inflamatory statement was included.

In reply to what he might've said:

Sure, <> functions mostly the same as !=, so you can say it means 'not equal to'. But the more accurate version would be, 'it is either bigger than or less than'. I can't think of an example that could show a difference (if one exists), but I think using != makes more sense. It reads more like a language, and readability is what it is all about.

In my opinion, we should always reference php.net when referencing PHP. W3Schools can be handy, but I liken it to Yahoo! Sports trying to compete with MLB.com. You just can't beat the official source.

I agree. I don't use W3schools because I don't really trust their code accuracy. PHP.net can be considered a peer reviewed source, whereas W3schools is a non-reviewed source. I'm sure the difference in value is obvious.