if statement with AND and OR


#1

In math when you see a math problem 3x4+7 it is understood that the multiplication is done first, and then the addition, so it would be (3x4)+7

But you can also write it 3x(4+7) and then the addition is done first.

Can parentheses be used like this in php to tell it how multiple AND and OR’s relate to each other? So that I can differentiate between :
(condition1 AND condition2) OR condition3 (both condition1 and condition2 must be met, or condition3 must be met)
condition1 AND (condition2 OR condition3) (condition1 must be met along with either condition2 or condition3)

And if it is written just as :
condition1 AND condition2 OR condition3
which way is it read?


#2

Yes


#3

http://www.php.net/manual/en/language.o … precedence

See order precedence.