PHP将两个二维数组合并为一个二维数组的方法

$a = array(0 => Array(id => 66,class_name => math),1 => Array(id => 67,class_name => linux ));
$b = array(0 => Array(class_count=> 8),1 => Array(class_count => 2));
$arr = array();
foreach($a as $k=>$r){
   $arr[] = array_merge($r,$b[$k]);
     }

 

转载于:https://www.cnblogs.com/lamp01/p/7112407.html

你可能感兴趣的:(PHP将两个二维数组合并为一个二维数组的方法)