In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how to write a three-dimensional array of php". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to write a three-dimensional array of php".
In PHP, the value in one array can be another array, and the value in another array can also be an array. In this way, we can create a three-dimensional array, such as "$a3=array ('a'));".
This article operating environment: windows7 system, PHP7.1 version, DELL G3 computer
What is the three-dimensional array of php?
The value in one array can be another array, and the value of another array can also be an array. In this way, we can create a 2D or 3D array:
Examples are as follows:
Definition:
1-dimensional array: $a1=array ('a')
2-dimensional array: $a2=array (array ('a')); / / that is, there is still an array in the array
3-dimensional array: $a3=array ('a')
Visit:
Dimension: $A1 [0]; / / fetch element a, same as below
Dimension: $a2 [0] [0]
3D: $a3 [0] [0] [0]
Special attention should be paid to:
$a2 [$A1 [0]] this does not take the elements of a two-dimensional array, but indicates that $a2 is an one-dimensional array, and we want to take the elements in $a2 with the subscript $A1 [0].
Thank you for your reading, the above is the content of "how to write the three-dimensional array of php". After the study of this article, I believe you have a deeper understanding of how to write the three-dimensional array of php, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.