August 2000
Intermediate to advanced
800 pages
13h 15m
English
There really is only one assignment operator, but PHP offers a handful of shortcut operators for combining assignment with another operator. Table 2.10 lists all the assignment operators.
All the assignment operators put a value into a variable. Specifically, they put a value on the right side into a variable on the left side. You may not reverse the order. The operators that combine another operator with an assignment operator operate on both the right and left sides and then put the result in the variable on the left. Listing 2.11 demonstrates equivalent statements.
| Operator | Operation Performed |
|---|---|
| = | Assign right side to left side |
| += | Add right side to left side |
| -= | Subtract right side from left side ... |
Read now
Unlock full access