O'Reilly logo

PHP and MySQL by Example by Marko Gargenta, Ellie Quigley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8Arrays

Image

8.1 What Is an Array?

An array of products, an array of pills, an array of shoes, an array of problems . . . When we speak of an array of things, we think of not just one, but a list or a lineup of more than one thing. PHP thinks the same way about data.

A variable that stores one value is called a scalar variable, whereas an array is a variable that can store a collection of scalars, such as an array of numbers, an array of strings, an array of images, colors, and so on (see Figure 8.1). If you want to define one number you would store it in a simple scalar variable, but if you want to store a whole list ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required