# How to use Arithmetic Operator in PHP

- 2231

**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**

<html> <head><title>Arithmetical Operators</title><head> <body> <?php $a = 84; $b = 40; $c = $a + $b; echo "Result of Addtion Operator: $c <br/>"; $c = $a - $b; echo "Result of Substraction Operator: $c <br/>"; $c = $a * $b; echo "Result of Multiplication Operator: $c <br/>"; $c = $a / $b; echo "Result of Division Operator: $c <br/>"; $c = $a % $b; echo "Result of Modulus Operator: $c <br/>"; $c = $a++; echo "Result of Increment Operator: $c <br/>"; $c = $a--; echo "Result of Decrement Operator: $c <br/>"; ?> </body> </html> |

**Output**

**Ask Your Question**

### Categories

### More Articles

- How to use Decision Making Statement in PHP
- How to use date in PHP
- How to use Conditional Operator in PHP
- How to use Assignment Operator in PHP
- What is PHP
- How To Use PHP Syntax
- How to use PHP variable
- How to use PHP Variable Scope
- How to use Arithmetic Operator in PHP
- How to use Switch Statement in PHP
- How to use numeric array in PHP
- How to use Associate Array in PHP
- How to use Multi-dimensional Array in PHP
- How to use while loop in PHP
- How to use do-while loop in PHP
- How to use for Loop in PHP
- How to use foreach Loop in PHP
- How to use simple function in PHP
- How to use function with parameter in PHP
- How to use Function-return value in PHP