W e b t u t o r i a l s

Define PHP

PHP Installation

PHP INI File

PHP Case Sensitivity

PHP Variable

PHP Echo & Print

PHP Operators

PHP Receiving Input

PHP Decision Making

PHP Loops

PHP Jumping Statement

PHP Image Gallery

PHP Arrays

PHP Date Functions

PHP String Functions

PHP Math Functions

PHP Functions

PHP Variable Scope

PHP Constant Variable

PHP Superglobals

PHP Form Validation

PHP Include Statement

PHP Filter

PHP File Handling

PHP File Upload

PHP Cookies

PHP Session

PHP Send Emails

PHP Captcha

PHP-MySQL Connectivity

PHP MySQL Select

PHP MySQL Insert

PHP MySQL Delete

PHP MySQL Update

PHP Operators

Operators are used to perform operations on variables and values. Operators are the symbols that tells the PHP processor to perform certain action. PHP divides the operators in the following categories:

Sno Lists Operator
1. Arithmetic Operators
+Addition
-Subtraction
*Multiplication
/Division
%Modulas
**Exponentiation
2. Assignment operators
=Assignment Operator
+=Addition Assignment
-=Subtraction Assignment
*=Multiplication Assignment
/=Divide Assignment
3. Comparison operators
>Greater than
<Less than
>=Greater than equals to
<=Less than equals to
!=
<>
Not equals to
==Equal, Equals to
===Strictly equal
4. Logical operators
&&
and
And
||
or
Or
!
not
Not
xorExclusive or
5. Increment/Decrement operators
$a++Post Increment
++$aPre Increment
$a--Post Decrement
--$aPre Decrement
6. String operators
.Concatenation
.=Concatenation assignment
7. Conditional Operator ? , :

Precedence of PHP Operators

Category Operator Associativity
Unary ! ++ -- Right to left
Multiplicative * / % Left to right
Additive + - Left to right
Relational < <= > >= Left to right
Equality == != Left to right
Logical AND && Left to right
Logical OR || Left to right
Conditional ? : Right to left
Assignment = , += , -= , *= , /= , %= Right to left