• Tutorial List

PHP Arithmetic Operators

Last updated May 15, 2020
PHP Arithmetic Operators

PHP Arithmetic Operators

The PHP Arithmetic Operators are used to perform common math operations, such as addition, subtraction, multiplication, etc. You can also call these, mathematical operators.

<?php
  $x = 6;
  $y = 2;
?>
OperatorNameExampleResult
+Addition
$x + $y
8
Subtraction
$x - $y
4
*Multiplication
$x * $y
12
/Division
$x / $y
3
%Modulus
$x % $y
0
**Exponentiation
$x ** $y
36 (62)
PHP Arithmetic Operators