# How to use Arithmetic Operator in PHP

In this article, I will explain how the Arithmetic operator can be used in PHP.
• 2284

PHP Operators

PHP language supports following type of operators.

• Arithmetic Operators
• Comparison Operators
• Logical (or Relational) Operators
• Assignment Operators
• Conditional (or ternary) Operators

Arithmetic Operators

The operators are summarized in the following table.

 Operator Name Description Example Result a+b Addition Sum of a and b 3+3 6 a-b Subtraction Difference of x and y 10-2 8 a*b Multiplication Product of x and y 2*6 12 a/b Division Quotient of x and y 10/2 5 a%b Modulus Remainder of x divided by y 7%3 1 -a Negation Opposite of x -5 x.y Concatenation Concatenate two strings "MCN"."Solution" MCNSolution

Example

 Arithmetical Operators ";     \$c = \$a - \$b;     echo "Result of Substraction Operator: \$c
";     \$c = \$a * \$b;     echo "Result of Multiplication Operator: \$c
";     \$c = \$a / \$b;     echo "Result of Division Operator: \$c
";     \$c = \$a % \$b;     echo "Result of Modulus Operator: \$c
";     \$c = \$a++;     echo "Result of Increment Operator: \$c
";     \$c = \$a--;     echo "Result of Decrement Operator: \$c
"; ?>

Output

You may also want to read these related articles here