Multidimensional Array
In this lesson, we will learn how to work with multidimensional arrays.
What are Multidimensional Arrays? #
PHP allows us to create multidimensional arrays. These arrays contain items that can be a single value or an array itself. These arrays can be thought of as an extension to the linear arrays. There is no limit to the dimensions of a multidimensional array. It can also be visualized as an array of arrays
Notice that in the figure above, the first index of the outer array is an array of two, whereas, the other two indices have arrays of three elements each. This means that PHP allows us to create multi-dimensional arrays where the elements (in this case array) at each ...