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

谋生成新数组好的办法

WBOY
WBOYOriginal
2016-06-13 12:53:55746browse

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


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

)

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

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