Sunday, 15 February 2015

PHP Arithmetic Operators

The PHP arithmetic operators are used with numeric values to perform basic arithmetic operations. For Ex. Addition, Subtraction, Multiplication etc.

Operator Name Description
-$a Negation Return Negative value of a given number 
$a + $b Addition Sum of given numbers
$a - $b Subtraction Difference of $a and $b
$a * $b Multiplication Production of given numbers
$a / $b Division Quotient of $a and $b
$a % $b Modulus Remainder of $a devide by $b 
$a ** $b Exponentiation Result of raising $a to the $b'th power 

Saturday, 14 February 2015

PHP Operators

An operator is some thing that takes one or more variables or values and performs action on them to produce results.

Operators can be grouped according several things. For example, can be grouped based on the type of operation they do or by the number of values they take.

The list of operator groups in PHP are:


  • Arithmetic Operators 
  • Assignment Operators
  • Bit wise Operators
  • Comparison Operators
  • Error Control Operators
  • Execution Operators
  • Infringement / Decrementig Operators
  • Logical Operators
  • String Operators
  • Array Operators
  • Type operators
Each one of these operators will be explained in individual post.