July 11, 2017

Core PHP: Assignment Operators (3.3)

Assignment Operators

Assignment operators work with numeric values to write values to variables.
$num1 = 5;
$num2 = $num1;

$num1 and $num2 now contain the value of 5.

Assignments can also be used in conjunction with arithmetic operators.
PHP: Assignment Operators


Example:
<?php
 $x = 50;
 $x += 100;
 echo $x;

 // Outputs: 150
?> 

No comments:

Post a Comment