Operators in PHP : Tutorial



In simple terms "Operator is something that takes one or more values and produces another value."

Depending upon the number of values an operator can take in, it can be divided into,

I. Unary operators : Take's only one value.

    ! (not/negative)
    ++ (increment operator)
    ++ (decremental operator)


II. Binary operators: Take's two values.

    + (addition)
    - (subtraction)
    * (multiplication)
    / (division)
    % (moduls)
    = (equals)
    == (boolean comparator operator)
    > (boolean greater)
    < (boolean less)
    && (boolean AND)
    || (boolean OR)


III. Ternary operator: Take's three values.

     value 1 ? value 2 : value 3

List of Operators

 1. Operator Precedence
 2. Arithmetic Operators
 3. Assignment Operators
 4. Bitwise Operators
 5. Comparison Operators
 6. Error Control Operators
 7. Execution Operators
 8. Incrementing/Decrementing Operators
 9. Logical Operators
 10. String Operators
 11. Array Operators
 12. Type Operators