Visit the Official PHP Website
Search this Site

PHP Programming

By James N Hitz

More Arithmetical and Logical Operators

PHP has a myriad of arithmetical and logical operators. Here is the complete list of these operators (in their Order of Precedence. PS: Those listed on the same row are on the same hierrachy in the precedence.):

{Less Precedent}
, 
or 
xor 
and 
print 
= += -= *= /= .= %= &= |= ^= ~= <<= >>=  
? : 
|| 
&& 
| 
^ 
& 
== != === !== 
< <= > >= 
<< >> 
+ - . 
* / % 
! ~ ++ -- (int) (double) (string) (array) (object) @ 
[ 
new 
{Most Precedent}

For a beginner some of these are... hard to comprehend. So for now we will make do with a few of these by looking at a less-detailed version of the above list of operators

<< Assigning Values to a Variable | Common Operators >>