PHP Operators Tutorials Online
×

PHP Operators

4104

PHP Operator is a symbol that tells the PHP processor to do certain actions. There are several operators used in PHP language, so we have separated them into the following categories to create it easier to learn them all.

In PHP have following operators, please see below point wise:

  • Arithmatic Operators
  • Assignment Operators
  • Comparison Operators
  • Increment/Decrement Operators
  • Logical Operators
  • String Operators
  • Array Operators

a) ARITHMATIC OPERATORS

PHP arithmetic operators used for numeric values to perform arithmetical operations, like addition, subtraction, multiplication, division, modulus etc.

Like: $a + $b, $a - $b, $a * $b, $a / $b, $a % $b


b) ASSIGNMENT OPERATORS

Assignment operator in PHP is "=". It means the left operand gets set the value of the assignment expression on the right.

Like :

A = B + C will assign value of B + C into A

A += B is equivalent to A = A + B
(Addition)
A -= B same as A = A - B
(Substraction)
A *= B same as A = A * B
(Multiplication)
A /=B same as A = A / B
(Division)
A %=B same as A = A % B
(Modulus)

c) COMPARISON OPERATORS

PHP comparison are compare to two values !!

Operator
Name of Operator
Example
==
Equal
$a == $b
!=
Not equal
$a != $b
<>
Not equal
$a <> $b
>
Greater than
$a > $b
<
Less than
$a <$b
>=
Greater than or equal to
$a >= $b
<=
Less than or equal to
$a <= $b


Best WordPress Hosting


Share:


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price



Leave a Reply


Comments
    Waiting for your comments