Chapter 8. Working with Arrays

In this chapter, you learn the following:

How to create associative and multidimensional arrays

How to use the myriad array-related functions built in to PHP

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

What Are Arrays?

You’ve already learned about and used scalar variables in the earlier chapters in this book, and therefore 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 be used to hold ...

Get Sams Teach Yourself PHP, MySQL® and Apache All in One, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.