亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

PHP basic syntax arithmetic operations

Arithmetic operators are the vast majority of knowledge we have learned in elementary school:

##*Multiply sign, multiply by $x * $y/division sign, divided by $x / $y%Remainder is also called modulus and modulus$x % $y
<?php

$x = 5;

$y = 6;
//5+6為11
echo $x + $y;

?>
<?php

$x = 20;

$y = 15;
//20 -15 為5
echo $x - $y;

?>
<?php

$x = 20;

$y = 15;
//20乘以15結(jié)果為300
echo $x * $y;

?>
<?php

$x = 10;

$y = 5;
//10除以5 結(jié)果為2
echo $x / $y;

?>
<?php

$x = 10;

$y = 3;
//$x 不能整除3,得到的余數(shù)為1,所以結(jié)果輸出為1
echo $x % $y;

?>
SymbolExplanationExample
+plus sign#$x + $y
-Minus sign$x - $y
Similar to what we have learned in mathematics, there is also a priority: multiplication and division first, then addition and subtraction. If you want to change the priority more explicitly, use () [parentheses] to enclose the value you want to take precedence.


Continuing Learning
||
<?php $x = 10; $y = 3; //$x 不能整除3,得到的余數(shù)為1,所以結(jié)果輸出為1 echo $x % $y; ?>
submitReset Code