Tutorial for Assignment operators

What is Assignment operators?

PHP Assignment operators are used to assign values to variables. The right side value is substituted for the left side value in the operand variable. Operators in this category are in charge of assigning variables. The most frequent assignment operator is =, which assigns the operand’s right side to the left variable.

  • Assignment Same as… Description
  • x = y x = y The left operand gets set to the value of the expression on the right
  • x += y x = x + y Addition
  • x -= y x = x - y Subtraction
  • x *= y x = x * y Multiplication
  • x /= y x = x / y Division
  • x %= y x = x % y Modulus

Example:-

Output:-

Tagged : / / / / / /