flames
03-02-2005, 05:02 AM
As you know, I had been using php for only a couple of months, and I had faced alot of problems and other challenges. Sometimes it even took me a few hours just to make a php-coded page!
I do not know if any of these easy rules are useful for everyone, but I am quite positive that php beginners should find this quite useful.
************************************************** *********
Common Operators (Comparison)
-=-=-=--=-=-=-=-=-=-=-=-=-=-
Operator
1.== means the equal operator. Used to test if two values are identical.
if($a == $b)
2.!= means the not equal operator. Used to test if two values are different.
if($a != $b)
3.> means the greater than operator (like in math). used to test if the first value is greater than the second value.
if ($a > $b)
4.< means the less than operator. used to test if the first value is smaller than the second value.
if($a < $b)
5.>= means the equal to or the greater operator. Used to test if the first value is greater than or equal to the second value.
if($a >= $b)
6.<= means the less than or equal to operator. used to test if one value is less than or equal to the second value.
if($a <= $b)
7.&& means the "and" operator. used to evaluate multiple conditions where you want all the conditions to be true.
if(($a == $b) && ($c == $d))
8.! means the "not" operator. Used to test if a condition is false.
if(($a == $b) ! ($c == $d))
9.|| means the "or" operator. Used to evaluate multiple conditions where you want any one of the conditions to be true.
if(($a == $b) || ($c == $d))
I do not know if any of these easy rules are useful for everyone, but I am quite positive that php beginners should find this quite useful.
************************************************** *********
Common Operators (Comparison)
-=-=-=--=-=-=-=-=-=-=-=-=-=-
Operator
1.== means the equal operator. Used to test if two values are identical.
if($a == $b)
2.!= means the not equal operator. Used to test if two values are different.
if($a != $b)
3.> means the greater than operator (like in math). used to test if the first value is greater than the second value.
if ($a > $b)
4.< means the less than operator. used to test if the first value is smaller than the second value.
if($a < $b)
5.>= means the equal to or the greater operator. Used to test if the first value is greater than or equal to the second value.
if($a >= $b)
6.<= means the less than or equal to operator. used to test if one value is less than or equal to the second value.
if($a <= $b)
7.&& means the "and" operator. used to evaluate multiple conditions where you want all the conditions to be true.
if(($a == $b) && ($c == $d))
8.! means the "not" operator. Used to test if a condition is false.
if(($a == $b) ! ($c == $d))
9.|| means the "or" operator. Used to evaluate multiple conditions where you want any one of the conditions to be true.
if(($a == $b) || ($c == $d))