CHAPTER 5Arrays

Much of your time as a programmer is spent working with data sets. Some examples of data sets include the names of all employees at a corporation; the U.S. presidents and their corresponding birth dates; and the years between 1900 and 1975. In fact, working with data sets is so prevalent that a means for managing these groups within code is a common feature of all mainstream programming languages. Within the PHP language, this feature is known as the array, which offers an ideal way to store, manipulate, sort, and retrieve data sets.

This chapter introduces arrays and the language's impressive variety of functions used to work with them. Specifically you'll learn how to do the following:

  • Create arrays
  • Output arrays
  • Test for ...

Get Beginning PHP and MySQL: From Novice to Professional, Third 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.