Chapter 6. Arrays
This chapter examines how you define, declare, assign, compare, and process arrays. It introduces the general concept of arrays before discussing the specifics of how PHP arrays work. The chapter covers the following array topics:
Defining arrays
Managing arrays
Sorting arrays
Merging and partitioning arrays
Arrays are programming structures that hold lists of like things. These lists are often indexed by a series of sequential numbers that start with zero or one and increase one value at a time. Using sequential numeric index values ensures that the index value can be used to traverse a complete list by incrementing or decrementing the index by 1 each iteration of a loop. Also, the lack of gaps in the array index leads to labeling ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access