O'Reilly logo

Core PHP Programming: Using PHP to Build Dynamic Web Sites by Leon Atkinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Operators

An operator is a symbol that tells PHP to perform a mathematical or logical operation. Some operators expect two arguments, some only one. Most operators fall into three categories: arithmetic, logical, and bitwise. There are some exceptions, however. Table 2.4 lists the arithmetic operators.

Table 2.4. Arithmetic Operators
OperatorOperation It Performs
+Addition
-Subtraction and Negation
*Multiplication
/Division
%Modulo Division
++Increment
--Decrement

Addition, subtraction, multiplication, and division are familiar concepts. They may be applied to integers or doubles. Using a string with an arithmetic operator causes the string to be converted to a number first. Modulo division returns the integer remainder of a division. The - operator ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required