Home  >  Article  >  Backend Development  >  怎么把上面的数组变成下面的数组

怎么把上面的数组变成下面的数组

WBOY
WBOYOriginal
2016-06-23 13:57:09965browse




回复讨论(解决方案)

for循环,设i=0,取上面数组长度m。
for($i=0,$i $data[i]=array($ids[i],$names[i],$adds[i])
}

取m值的方法,记不得了,不过用循环可以判断出来。
$i=0
while($ids[$i]){
i++
}

不懂编程,只是偶尔看过些C语言的书,希望能帮到你。

$data = array_map(null, $ids, $names, $adds);

//笨一点的方法$data[] = $ids;$data[] = $names;$data[] = $adds;

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