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

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

WBOY
Release: 2016-06-23 13:57:09
Original
997 people have browsed it




回复讨论(解决方案)

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);
Copy after login

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

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