Hi All! I'm amateur PHP coder and is wondering about these comparison operators. Mostly I use x == y, x != y, x < y , x > y, x <= y, and x >= y. But sometimes I see a nerd use these operators: x => y, and x -> y. So when should I use these. Is there tutorial about this. I've done some research but yield nothing. Thanks in advance.
You can find everything you need to know on the PHP site! A quick search and you can find them all here; http://php.net/manual/en/language.operators.php If there is a specific operator that is causing you grief, let me know
Thanks for response. I'll learn how to use them. Edited: It's look like I'm going to get an headache with this tutiorial. D:
This 2 are not comparison operators: x => y, and x -> y. In some languages, not PHP, x=>y is the same as y<=x. In PHP, => is not a comparisson, so avoid using it !!! => is used in arrays definitions (see arrays on the php help) $arr = array("foo" => "bar", 12 => true); echo $arr["foo"]; // bar echo $arr[12]; // 1 -> is not a comparison operator !!! Usually, on C++, it's used as a "pointer reference", to use a property/method of an object. In PHP, you can use the DOT (.) So, please, don't use => nor -> as comparison operators, because they are not.