Free Beginner PHP Tutorials - Assignment operators
2016:09:26 / Science and Tutorials
This are symbols or combinations of symbols that assign combine values or compare values in PHP. See example:-
Operators are used to perform operations on variables and values.
Php categorizes the operators into various groups:
1. Assignment operators
2. Arithmetic operators
3. Comparison operators
4. Increment/Decrement operators
6. Logical operators
7. String operators
8. Array operators
For this tutorial, we will discuss how to use the Assignment operator and the condition where it should be employed.
The assignment operator is defined as an operator that assign the value of its right operand to its left operand.
The basic assignment operator in PHP is the equal sign "=". It means that the left operand gets to set the value of its right operand to its left operand.
<?php //expression 1 x=y; //expression 2 $x = 30; ?>
The above expression (1) means the x value is assigned the value of y
The above expression (2) means the $x variable is assigned the value of 30.