Quackit Logo

FREE Hosting!

With every domain name you register with ZappyHost, you get FREE hosting.

$1.99 Domain Names

With every new non-domain purchase thru ZappyHost, you get a domain name for only $1.99.

PHP Operators

Print Version

PHP operators are characters (or sets of characters) that perform a special operation within the PHP code. For example, when you use the equals sign ( = ) to assign a value to a variable, you are using an assignment operator. When you add two numbers together using a plus sign ( + ), you are using an arithmetic operator.

Here's a list of the various PHP operators:

Artithmetic Operators

OperatorDescription
+Addition
-Subtraction
*Multiplication
/Division
%Modulus (remainder of a division)
++Increment
--Decrement

Assignment Operator

OperatorDescription
=Assign
+=Increments, then assigns
-=Decrements, then assigns
*=Multiplies, then assigns
/=Divides, then assigns
%=Modulus, then assigns

Comparison Operators

OperatorDescription
==Is equal to
!=Is not equal to
>Greater than
>=Greater than or equal to
<Less than
<=Less than or equal to

Logical Operators

OperatorDescription
&&And operator. Performs a logical conjunction on two expressions (if both expressions evaluate to True, result is True. If either expression evaluates to False, result is False)
||Or operator. Performs a logical disjunction on two expressions (if either or both expressions evaluate to True, result is True).
!Not operator. Performs logical negation on an expression.

Concatenation Operators

OperatorDescription
.Concatenate (join two strings together)

Enjoy this website?

  1. Link to this page (copy/paste into your own website or blog):
  2. Add this page to your favorite social bookmarks sites:
               
  3. Add this page to your Favorites

Oh, and thank you for supporting Quackit!