Home >Backend Development >PHP Tutorial >如何把上面的数组变成下面的数组

如何把上面的数组变成下面的数组

WBOY
WBOYOriginal
2016-06-13 11:57:06909browse

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



------解决方案--------------------
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);

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