• Tutorial List

What are PHP Operators & PHP Operator types

Last updated May 15, 2020
What are PHP Operators & PHP Operator types

What are PHP Operators?

Operators are signs or symbols that are used to perform operations with variables and values. Like: +, -, =, ==, > etc.

Example –

In the following example, the + plus is an operator and it is used to perform additions.

  $x = 5;
  $y = 4;
  echo $x + $y;
Browser Output

PHP Operator types

In PHP, there are so many operators. PHP divides these operators into the following groups –

  • Arithmetic Operators
  • Assignment Operators
  • Comparison Operators
  • Incrementing and Decrementing Operators
  • Logical Operators
  • String Operators
  • Array Operators
  • Spaceship Operator (Introduced in PHP 7)

This is a list of the most used operators. But in PHP, there are also more operators. Check out the list of all operators.