## PHP Arithmetic Operators

PHP Arithmetic Operators are used to perform basic arithmetic operations on numerical values in PHP. The arithmetic operators in PHP are similar to other programming languages and allow you to perform addition, subtraction, multiplication, division, modulus, and exponentiation operations.

These operators can be used with numeric data types such as integers, floating-point numbers, and doubles. They are useful when performing calculations or manipulating numeric values within a PHP program. Arithmetic operators can be used with variables, constants, and literal values.

PHP Arithmetic Operators are used to perform basic arithmetic operations on numerical values. Here are the arithmetic operators in PHP:

``````\$a = 10;
\$b = 20;
\$c = \$a + \$b; // \$c is 30``````
1. Subtraction (-): Subtracts the second value from the first value Example:.
``````\$a = 20;
\$b = 10;
\$c = \$a - \$b; // \$c is 10``````
1. Multiplication (*): Multiplies two values Example:
``````\$a = 5;
\$b = 6;
\$c = \$a * \$b; // \$c is 30``````
1. Division (/): Divides the first value by the second value Example:
``````\$a = 20;
\$b = 5;
\$c = \$a / \$b; // \$c is 4``````
1. Modulus (%): Returns the remainder of the first value divided by the second value Example:
``````\$a = 20;
\$b = 3;
\$c = \$a % \$b; // \$c is 2``````
1. Exponentiation (**): Raises the first value to the power of the second value Example:
``````\$a = 2;
\$b = 3;
\$c = \$a ** \$b; // \$c is 8``````
Operator NameExample
subtraction operator (-)4-1 output  3
division operator (/)10/2 output 5
modulus operator (%)3*2 output 6
multiplication operator (*)

3*2 output 6

Logical OperatorsAnd or &&,or or ||,Xor
String Operators

Â .(Dot)

Example for PHP Arithmetic Operators

``````<?php
\$n=40;
\$m=20;