PHP assignment operators
PHP assignment operators are used to assign value in a variable such that we can assign value 10 in a variable $a like that $a=10. Now the value of $a is 10 because we assign 10 in variable a.
equal (=) sign is used to represent PHP assignment operator but in array we use => sign to assign value. Now take a look at an example of PHP assignment operators.
We can use PHP arithmetic operator in PHP assignment operator. Here is an example:
equal (=) sign is used to represent PHP assignment operator but in array we use => sign to assign value. Now take a look at an example of PHP assignment operators.
<?phpSave and run the above code.
$a = 20;
echo $a;
?>
We can use PHP arithmetic operator in PHP assignment operator. Here is an example:
<?php
$a=10;
$a+=10;
echo $a;
?>
Comments
Post a Comment