Introduction to Operators

This lesson briefly covers operators and their various types.

We'll cover the following

What are Operators? #

An operator is something that takes one or more values (or expressions, in programming jargon) and yields another value (so that the construction itself becomes an expression). For instance, when you add two numbers, say 2 and 5 (values) it yields 7 (value), such that the construction itself becomes an expression, i.e. 2+5=7.

Types of Operators #

There are multiple types of operators for various purposes, i.e.,

  • arithmetic operators
  • comparison operators
  • logical operators
  • assignment operators

The following figure illustrates the various kinds of operators in PHP:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy