In all programming languages, operators are used to manipulate or perform operations on variables and values. You have already seen the string concatenation operator “.” in the Echo Lesson and the assignment operator “=” in pretty much every PHP example so far.
There are many operators used in PHP, so we have separated them into the following categories to make it easier to learn them all.
Assignment Operators
Arithmetic Operators
Comparison Operators
String Operators
Combination Arithmetic & Assignment Operators
Assignment operators are used to set a variable equal to a value or set a variable to another variable’s value. Such an assignment of value is done with the “=”, or equal character.
Example:
$roll = 4;
$urp = $roll;
Now both $roll and $urp contain the value 4. Assignments can also be used in conjunction with arithmetic operators.
Arithmetic Operators

Note : Modulus is a reminder after division.
Consider Following simple example
< ?php
$num1=6;
$num2=2;
echo $num1+$num2; //Addition - 8
echo $num1-$num2; //Substraction - 4
echo $num1*$num2; //Multiplication - 12
echo $num1/$num2; //Division - 3
echo $num1%$num2; //Modulus – 0
?>
Comparisons are used to check the relationship between variables and/or values. We will see comparision operators in details with IF statement in next chapter.

Combination Arithmetic & Assignment Operators
In programming it is a very common task to have to increment a variable by some fixed amount. The most common example of this is a counter. Say you want to increment a counter by 1, you would have:
$counter = $counter + 1;
However, there is a shorthand for doing this.
$counter += 1;
This combination assignment/arithmetic operator would accomplish the same task. The downside to this combination operator is that it reduces code readability to those programmers who are not used to such an operator. Here are some examples of other common shorthand operators. In general, “+=” and “-=” are the most widely used combination operators.

Pre/Post-Increment & Pre/Post-Decrement
This may seem a bit absurd, but there is even a shorter shorthand for the common task of adding 1 or subtracting 1 from a variable. To add one to a variable or “increment” use the “++” operator:
$x++; Which is equivalent to $x += 1; or $x = $x + 1;
To subtract 1 from a variable, or “decrement” use the “–” operator:
$x–; Which is equivalent to $x -= 1; or $x = $x - 1;
Logical Operators :
Operator English
&& And operator
|| Or operator
These both operators are used to combine more than one conditions. We will see it in details with IF statement.


