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

PHP basic syntax assignment operation

Assignment operation

Assignment operation, we have already learned it.

In mathematics, we call = (an equal sign) an assignment operator, that is, assign the value on the right side of the equal sign to the variable on the left side of the equal sign, and the variable on the left side becomes the value on the right side.

The code runs from top to bottom, so the assignment can be repeated from top to bottom:

<?php

$x = 5;

$x = true;

$x = '愛你';

$x = 12.888;

echo $x;
?>

In the above example, x is repeatedly assigned to different types of values. We have studied the above many times.

Then there are several assignment operators in PHP:

##/=$x /= $ y$x = $x / $y%=$x %= $y$x = $x % $y.=$x .= $y#$x = $x . $y
SymbolExampleEquivalence
+=$x += $y$x = $x + $y
-=#$x -= $y$x = $x - $y
*=$x *= $y$x = $x * $y
The above examples and equivalent equations are clearly explained.

$x += $y is equivalent to $x = $x + $y

<?php

$x = 5;

$y = 8;

$x += $y;

echo $x;
?>

Just remember all the above. These are all grammatical rules, nothing much to say.


Continuing Learning
||
<?php $x = 5; $y = 8; $x += $y; echo $x; ?>
submitReset Code