Home>Article>Backend Development> Types of PHP arrays - multidimensional arrays
Types of PHP arrays - multidimensional arrays
What is a PHP multidimensional array?
The two articles introduced earlier "Types of PHP arrays-numeric index array" and "Types of PHP arrays-associative arrays" They are all one-dimensional arrays. Today we will introduce multi-dimensional arrays in detail!
Arrays with more than one dimension can be called multi-dimensional arrays
We need to understand that an array is not necessarily a simple list of subscripts and values. In fact, each element in the array The elements can also be another array.
So if the array element in a one-dimensional array is also an array, then it becomes a two-dimensional array.
PHP multi-dimensional array sample code
##Dimensions of the array: two-dimensional
Define the above two-dimensional array: The way to obtain the element "Li Qiang" in the above two-dimensional array is as follows: The output result is :##Dimensions of the array: three-dimensional
Method to obtain "Li Qiang" and "Liu Jun":
"; echo $arr[1][1][1];//获取刘军的方式 ?>
The output result is:
【Related tutorial recommendations】
php array (Array)"
The above is the detailed content of Types of PHP arrays - multidimensional arrays. For more information, please follow other related articles on the PHP Chinese website!