国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

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