Monday, March 4, 2024

PHP operators

PHP operators

PHP operators


PHP operators 

  1. 1] Arithmetic Operators:

    • Addition (+)
    • Subtraction (-)
    • Multiplication (*)
    • Division (/)
    • Modulus (%)
    • Exponentiation (**)
  2. 2] Assignment Operators:

    • Assignment (=)
    • Addition assignment (+=)
    • Subtraction assignment (-=)
    • Multiplication assignment (*=)
    • Division assignment (/=)
    • Modulus assignment (%=)
  3. 3] Comparison Operators:

    • Equal (==)
    • Identical (===)
    • Not equal (!= or <>)
    • Not identical (!==)
    • Greater than (>)
    • Less than (<)
    • Greater than or equal to (>=)
    • Less than or equal to (<=)
  4. 4] Logical Operators:

    • AND (&& or and)
    • OR (|| or or)
    • NOT (! or not)
    • XOR (exclusive OR) (xor)
  5. 5] Increment/Decrement Operators:

    • Increment (++)
    • Decrement (--)
  6. 6] String Operators:

    • Concatenation (.)
    • Concatenation assignment (.=)
  7. 7] Array Operators:

    • Union (+)
    • Equality (==)
    • Identity (===)
    • Inequality (!= or <>)
    • Not identical (!==)
  8. 8] Ternary Operator:

    • Syntax :-
  9. (condition) ? expression1 : expression2;

it works:

  • 1] If the condition evaluates to true, the expression1 is executed.
  • 2] If the condition evaluates to false, the expression2 is executed.
READ MORE

No comments:

Post a Comment