Operators in PHP - List of Operators in PHP, How to use Operators in PHP


Operators in PHP - List of Operators in PHP, How to use Operators in PHP

Symbols which are used to perform some types of operation on operands are called operators the php support all king of operators which are used in other languages. The following type of operators are php support-


  • Arithmetic Operators
  • Assignment Operators
  • Increment/Decrements Operators
  • Comparison Operators
  • Logical Operators
  • Array Operators   

Arithmetic Operators :-

(+) Operator - Used to add two integers or real numbers.
(-) Operator - Used to subtract two integers or real numbers.
(*) Operator - Used to multiply two integers or real numbers.
(/) Operator - Used to add divide integers or real numbers.
(%) Operator - Used to find Remainder of two integers or real numbers.

Assignment Operators:-

(=) Operator - used to assign a value to a variable.
(+=) Operator - used to add two variables and store it to a variable.
(-=) Operator - used to subtract two variables and store it to a variable.
(*=) Operator - used to multiply two variables and store it to a variable.
(/=) Operator - used to divide two variables and store it to a variable.
(%=) Operator - used to find remainder of two variables and store it to a variable.


Increment/Decrements Operators:-

(x++) - used for Post Increment.
(++x) - used for Pre Increment.
(x--) - used for Post Increment.
(--x) - used for Pre Increment.





{ 0 comments... read them below or add one }

Post a Comment