© Gunnard Engebreth, Satej Kumar Sahu 2023
G. Engebreth, S. K. SahuPHP 8 Basicshttps://doi.org/10.1007/978-1-4842-8082-9_6

6. Arrays

Gunnard Engebreth1   and Satej Kumar Sahu2
(1)
Madison, WI, USA
(2)
Bangalore, India
 

In the previous chapters, you learned how to deal with PHP variables. In this chapter, we will teach you how to create and manage PHP arrays.

Say you need to hold multiple values of a similar type in a single variable, without creating additional variables to store those values. How would you do this? By using PHP arrays.

This chapter consists of the following sections:
  • PHP Indexed and Associative Arrays

  • PHP Multidimensional Arrays

  • PHP Array Functions

PHP Indexed and Associative Arrays

Arrays are one of the most versatile and useful elements ...

Get PHP 8 Basics: For Programming and Web Development 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.