Friday 10, February 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    Forum    |    About Us    |    Contact Us

Operators

Operators are used to manipulate or perform operations on variables and values. There are many operators used in PHP, we have separated them into the following categories.
  1. Assignment Operators
  2. Arithmetic Operators
  3. Comparison Operators
  4. Logical Operators

 

Assignment Operators:

Assignment operators are used to set a variable equal to a value or set a variable to another variable's value. ‘=’ is used for assignment operator.

Example:
$var = 23;
$var2 = $var;
Operator
Example
Is The Same As
=
a=b
a=b
+=
a+=b
a=a+b
-=
a-=b
a=a-b
*=
a*=b
a=a*b
/=
a/=b
a=a/b
.=
a.=b
a=a.b
%=
a%=b
a=a%b

 

Arithmetic Operators:
Operator
Function
+
Addition
-
Subtraction
*
Multiplication
/
Division
%
Modulus (division remainder)
++
Increment
--
Decrement

 

Comparison Operators:
Operator
Function
Example
Result
==
Equal To
$x == $y
false
!=
Not Equal To
$x != $y
true
<
Less Than
$x < $y
true
>
Greater Than
$x > $y
false
<=
Less Than or Equal To
$x <= $y
true
>=
Greater Than or Equal To
$x >= $y
false
 
Logical Operators:
Operator
Function
Example
&&
and
x=8
y=4
(x < 10 && y > 1) returns true
||
or
x=12
y=8
(x>=5 || y<=5) returns true
!
not
x=6
y=3
!(x==y) returns true
 
     
   
PHP Tutorial
 
  Introduction
Introduction
  Variables
Variables
  Strings
Strings
  Operators
Operators
  If Else Statement
If Else Statement
  Loops
Loops
  Functions
Functions
  Forms
Forms
  Sessions
Sessions
  Cookies
Cookies
  Files
Files
  E-mail
E-mail
  Error Handling
Error Handling
  File Upload
File Upload
  PHP Databases
PHP Databases
  Connecting to a MySQL Database
Connecting to a MySQL Database
  MySQL Data Types
MySQL Data Types
  Inserting Data Into a Table
Inserting Data Into a Table
  Select Statement
Select Statement
  Where Clause
Where Clause
  Order By
Order By
  Update Statement
Update Statement
  Delete From Statement
Delete From Statement
 
 
 
Web Designing Tutorials
  HTML Tutorial
HTML Tutorial
  DHTML Tutorial
DHTML  Tutorial
  CSS Tutorial
CSS Tutorial
  XHTML Tutorial
XHTML Tutorial
 
Programming Languages Tutorials
  C Language Tutorial
C Language Tutorial
  C++ Tutorial
C++ Tutorial
  Java Language Tutorial
Java Language Tutorial
  Data Structure Theory Tutorial
Data Structure Theory Tutorial
 
Server Side Scripting Tutorials
  PHP Tutorial
PHP Tutorial
  SQL Tutorial
SQL Tutorial
  ASP Tutorial
ASP Tutorial
 
Client Side Scripting Tutorials
  JavaScript Tutorial
JavaScript Tutorial
  VBScript Tutorial
VBScript Tutorial
 
 
 
POPULAR E-BOOKS
 
Download Completing the Sale Successfully Ebook Completing the Sale Successfully
   
Download Project Oberon - The Design of an Operating System and Compiler  Ebook Project Oberon - The Design of an Operating System and Compiler
   
Download Yahoo Answers Traffic Guide Ebook Yahoo Answers Traffic Guide
   
Download Golden Adsense Strategy  Ebook Golden Adsense Strategy
   
Download Make Money Online Ebook Make Money Online
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz