Practical PHP Programming:Simple variables and operators
From IpbWiki
Once you are up and running with your own PHP programming, you will find that the majority of your scripts are variables, operators, and under ten functions that you use commonly.
In this chapter we will be looking at the different types of variables used in PHP, which to use and when, and also how to convert between the different types. We'll also be looking at operators - these are things that have any effect on variables, such as adding, subtracting, and multiplying.
This chapter is designed to give you complete information on how PHP's variables work - you need not understand some of the more complicated parts, such as references or variable variables, unless you really want full comprehension of the language.
The topics covered here are:
- What types of data are available to you
- References, typecasting, and variable variables
- Script variables, pre-set variables, script constants, and pre-set constants
- Operators such as plus, minus, multiply, and divide
Contents
- 2.1. Practical_PHP_Programming:Types of data
- 2.2. Practical_PHP_Programming:Checking a variable is set
- 2.3. Practical_PHP_Programming:Automatic type conversion
- 2.4. Practical_PHP_Programming:Forcing a type with type casting
- 2.5. Practical_PHP_Programming:Non-decimal number systems
- 2.6. Practical_PHP_Programming:Variable scope
- 2.7. Practical_PHP_Programming:Variable variables
- 2.8. Practical_PHP_Programming:The superglobal arrays
- 2.9. Practical_PHP_Programming:Helpful pre-set variables
- 2.10. Practical_PHP_Programming:References
- 2.11. Practical_PHP_Programming:Constants
- 2.12. Practical_PHP_Programming:Operators
- 2.12.1. Practical_PHP_Programming:Shorthand unary operators
- 2.12.2. Practical_PHP_Programming:Comparison operators
- 2.12.3. Practical_PHP_Programming:Complete operator list
- 2.12.4. Practical_PHP_Programming:Ternary operator
- 2.12.5. Practical_PHP_Programming:Scope resolution operator
- 2.12.6. Practical_PHP_Programming:Execution operator
- 2.12.7. Practical_PHP_Programming:Operator precedence and associativity
