So I am porting a VBA application to PHP and ran into this wonderful little nugget of code:
expr1 = expr2 Mod expr3 = 0
I thought it was behaving like a ternary operator but when I broke it down to simple if then statements the outcome was not as expected. So I ask the brilliant stackoverflow community to help me out and put it in easy to understand terms. I know by looking at the other answers I will not be let down. [/end brown_nose>]
It is the modulus operator:
a MOD b = remainder of a/b
in PHP it is the % sign:
a%b
So the line
expr1 = expr2 Mod expr3 = 0
means: expr1 is true, if expr2 can be divided by expr3 without any remainders: eg:
20 MOD 5 = 0 ==> TRUE
22 MOD 5 = 2 ==> FALSE