假设我有这些数组:
$group1= array('id' => '1','title' => 'Group 1','description' => 'This is group1');
$group2= array('id' => '2','title' => 'Group 2','description' => 'This is group2');
$group3= array('id' => '3','title' => 'Group 3','description' => 'This is group3');
如何将它们组合成一个多维数组,如下所示:
$groups=array(array('id' => '1','title' => 'Group 1','description' => 'This is group1'),array('id' => '2','title' => 'Group 2','description' => 'This is group2'),array('id' => '3','title' => 'Group 3','description' => 'This is group3'))
我试过使用 array_map 但它没有产生我需要的数组。谢谢。