Assignment Operators
Assignment operators work with numeric values to write values to variables.
$num1 = 5;
$num2 = $num1;
$num2 = $num1;
$num1 and $num2 now contain the value of 5.
Assignments can also be used in conjunction with arithmetic operators.
Example:
<?php
$x = 50;
$x += 100;
echo $x;
// Outputs: 150
?>
$x = 50;
$x += 100;
echo $x;
// Outputs: 150
?>
No comments:
Post a Comment