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.
<?php
$a = 20;
echo $a;
?>
Save and run the above code.
We can use PHP arithmetic operator in PHP assignment operator. Here is an example:
<?php
$a=10;
$a+=10;
echo $a;
?>

Comments

Popular posts from this blog

How to construct a B+ tree with example

How to show only month and year fields in android Date-picker?

Visitor Counter Script Using PHP