1, +: Plus
2,-: minus
3, *: Multiply
4,/: except
5,%: modulo, get the remainder of the division of two numbers
6. + +: Self-added
7 、--: Self-reduction
8, + +: Left add
9.-=: Left minus
10. *=: Left Multiply
11./=: Left apart
12,%=: Left to take the mold
Example: Programming a PHP program to determine whether two numbers are divisible .
<?php
$a = 100;
$b = 3;
$c = $a% $b;
if ($c) {
echo "is not divisible! ";
}else{
echo "Can divide! ";
}
?>
Examples of PHP self-addition and self-subtraction operators :
Example 1:
<?php
$a = 90;
$a + +; Equivalent to $a= $a +1;
echo $a;
$b = 80;
$b--; Equivalent to $b= $b-1;
echo ' <br/> '. $b;
?>
Example 2:
<?php
$a = 90;
$b = $a + +; After + +, first use the value, then add 1. The statement is equivalent to the $b= $a; $a = $a +1;
Echo $b; Output 90
echo ' <br/> '. $a; Output 91
?>
Example 3:
<?php
$a = 90;
$b =++ $a; First + +, add 1 First, then use the value. The statement is equivalent to the $a= $a +1; $b = $a;
Echo $b; Output 91
echo ' <br/> '. $a; Output 91
?>
examples of Zoga :
<?php
$a = 90;
$a +=90; Equivalent to $a= $a +90;
echo $a; Output 180
?>