Home > Backend Development > PHP Tutorial > 谋生成新数组好的办法

谋生成新数组好的办法

WBOY
Release: 2016-06-13 11:14:33
Original
852 people have browsed it

求生成新数组好的办法
RT。如何让2个结构完全一样的数组合并成一个新的数组。用array_merge后面的数组会覆盖前面的。
数组结构为


------解决方案--------------------
我猜你是这个意思
$a = array('a' => 1);<br />$b = array('a' => 1);<br /><br />print_r(array_merge_recursive($a, $b));
Copy after login
Array
(
    [a] => Array
        (
            [0] => 1
            [1] => 1
        )

)

------解决方案--------------------
引用:
PHP code?123456789101112131415用array_merge_recursive。。然后$arr = array();         $count =  count($data['id']);        for($i=0;$i

妹纸 你就像一朵奇葩在风中颤抖着......
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