Home > Backend Development > PHP Tutorial > 请问怎么创建一个二维数组

请问怎么创建一个二维数组

WBOY
Release: 2016-06-13 11:17:50
Original
1105 people have browsed it

请教如何创建一个二维数组?
已知一个while循环里面会产生n个一维数组:
while(循环n次){
    $arr = array(...);//产生一个一维数组
}

那如何把这n个一维数组放到 一个数组里面?

二维数组
------解决方案--------------------
看一下array_push()和array_merge()方法
http://www.w3schools.com/php/php_ref_array.asp
------解决方案--------------------
while(循环n次){
    $arr[] = array(...);//产生一个一维数组
}
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template