Home  >  Article  >  Backend Development  >  请教如何创建一个二维数组?

请教如何创建一个二维数组?

WBOY
WBOYOriginal
2016-06-23 14:03:151759browse

已知一个while循环里面会产生n个一维数组:
while(循环n次){
    $arr = array(...);//产生一个一维数组
}

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


回复讨论(解决方案)

看一下array_push()和array_merge()方法
http://www.w3schools.com/php/php_ref_array.asp

while(循环n次){
    $arr[] = array(...);//产生一个一维数组
}

Statement:
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