Math Operators in PHP

Examples

Explanation

+ adds two numbers.

- subtracts the second number from the first.

* multiplies two numbers.

/ divides the first number by the second and can produce decimals.

% gives the remainder after division.