Chapter 8. Working with Arrays

Arrays are used to store and organize data. PHP includes many functions that enable you to create, modify, and manipulate arrays, which you will use frequently throughout the procedural programming method described in this book.

In this chapter, you learn the basics of working with arrays, including

  • How to create associative and multidimensional arrays

  • How to use the myriad array-related functions built into PHP

What Are Arrays?

You’ve already learned about and used scalar variables in the earlier chapters in this book, and thus you know that these variables are used to store values. But scalar variables can store only one value at a time—the $color variable can hold only a value of red or blue, and so forth, but it cannot ...

Get Sams Teach Yourself PHP, MySQL now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.