Operators

Now that you have data values to work with, you need some operators to use, too. You have already used + to add variables together, but many others in PHP handle arithmetic, comparison, assignment, and other operators. Operator is just a fancy word for something that performs an operation, such as addition or subtraction. However, operand might be new to you. Consider this operation:

$a = $b + c;

In this operation, = and + are operators, and $a, $b, and $c are operands. Along with +, you also already know – (subtract), * (multiply), and / (divide), but Table 43.2 provides some more.

Image

TABLE 43.2 PHP Operators

At least 10 other operators ...

Get Ubuntu Unleashed 2015 Edition: Covering 14.10 and 15.04, Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.