By now, you must have started writing those scripts and started working on PHP. Now, it’s time for you to learn about the operators available in PHP. An operator is something in which one or more values are fed and it gives another value as a result.
In general there are three types of operators:
- Unary – it operates on only one value.
- Binary – it operates on two or more than two values.
- Ternary – it is used to select between two expressions depending on the third one.
There are many types of operators in PHP; some of them are useful but some are not. In this tutorial we will be studying about the most useful operators in PHP, which are:
- Arithmetic operators
- Assignment operators
- Comparison operators
- Logical operators
Result = 30
Result = 5
Result = 10
Result = 15
Result = 1
Result = 6
Result = 4