Once you are up and running with your own PHP programming, you'll 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 needn't 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
Want to learn PHP 7?
Hacking with PHP has been fully updated for PHP 7, and is now available as a downloadable PDF. Get over 1200 pages of hands-on PHP learning today!
If this was helpful, please take a moment to tell others about Hacking with PHP by tweeting about it!
Next chapter: Types of Data >>
Previous chapter: Next chapter
Jump to:
Home: Table of Contents
Copyright ©2015 Paul Hudson. Follow me: @twostraws.