Arithmetic
Arithmetic is rooted deep within programming—not just PHP, but other languages, too—and rightly so, because all a computer knows is numbers. PHP provides you with several different types of arithmetic operators, some of which will be familiar to you as common mathematical symbols, such as plus and minus. There are others, though, that are just as simple and have been added to make your job of programming easier. Arithmetic will also open the doors to being able to use patterns, which are just as powerful as arithmetic itself.
This chapter teaches you the following:
Mathematical expressions
Arithmetic operations
Arithmetic operator precedence
Compound operators
Applying arithmetic with patterns