Variables are the backbone of any programming language—but what is a variable? All variables contain a value that you can change throughout the program. What can a variable hold? Well, anything really. If you want to track who last visited your site to use the form, you can store the visitor’s name inside a variable. If you want to create a message board, a variable can save the message that is to be posted.
There are numerous types of variables, and they’re listed in Table 4.1. Each type stores a different type of data. For example, PHP draws a distinction between the number 343 and 343.14. PHP handles them different ways, so you can get some weird results when you try to divide a whole number by a fraction, for instance.