Chapter 7. Using Arrays

The next variable type you’ll learn about in this book is arrays. Arrays are significantly different than either numbers or strings, and you can’t make the most of programming in PHP without comprehending them.

Because of their unique nature, this chapter will cover arrays more deliberately and slowly than the other variable types. The chapter begins with a thorough introduction to the concept, along with the basics of creating and using arrays. Then it covers some of the array-related functions and concludes with multidimensional arrays.

What Is an Array?

Arrays constitute a complicated but very useful notion. Whereas numbers and strings are scalar variables (meaning they only ever have a single value), an array is a collection ...

Get PHP for the World Wide Web, Second Edition: Visual Quickstart Guide 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.