php operators
php operators
As in any programming language, PHP also has operators which are symbols
(sometimes keywords) that are predefined to perform certain commonly
required operations on one or more operands.
For example, using the expression "4 + 5" is equal to 9. Here "4" and "5" are
called operands and "+" is called an operator.
Arithmetic Operators
Comparison Operators
Logical Operators
Assignment Operators
String Operators
Array Operators
Conditional (or Ternary Operators)
This chapter will provide an overview of how you can use these operators in
PHP. In the subsequent chapters, we will take a closer look at each of the
operators and how they work.
The following table highligts the arithmetic operators that are supported by
PHP. Assume variable "$a" holds 42 and variable "$b" holds 20 −
Operator Description
Explore our latest online courses and learn new skills at your own pace.
Enroll and become a certified expert to boost your career.
You would use Comparison operators to compare two operands and find the
relationship between them. They return a Boolean value (either true or false)
based on the outcome of the comparison.