Home  >  Article  >  Backend Development  >  求教怎么合并数组

求教怎么合并数组

WBOY
WBOYOriginal
2016-06-13 12:43:26749browse

求教如何合并数组


//比如下面两个数组
$a1=array(2=>array(1,2),3=>array(4));
$a2=array(2=>array(5),5=>array(4));
/**
*我想$a1跟$a2合并的结果为 array(2=>array(1,2,5),3=>array(4),5=>array(4));
**/

有什么好的方法?

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