Math Operations Example

Addition: 5 + 3 = 8

Subtraction: 10 - 2 = 8

Multiplication: 4 * 3 = 12

Division: 20 / 4 = 5

Modulus: 10 % 3 = 1 (remainder of 10 divided by 3)

Pre-increment: ++$a = 6 (Increments $a to 6, then returns 6)

Post-increment: $b++ = 5 (Returns 5, then increments $b to 6)

Pre-decrement: --$c = 4 (Decrements $c to 4, then returns 4)

Post-decrement: $d-- = 5 (Returns 5, then decrements $d to 4)

Understanding Arithmetic Operators in PHP

PHP supports basic arithmetic operators: