Array
(
[0] => Array
(
[paper_id] => 2
[student] => 小丸子
[subject] => 信息技术
[sj_title] => 信息考试
[paper_createtime] => 2015-10-14 13:39:08
)
[1] => Array
(
[paper_id] => 2
[student] => 小丸子
[subject] => 信息技术
[sj_title] => 信息考试
[paper_createtime] => 2015-10-14 13:39:08
)
)
数组b
Array
(
[0] => Array
(
[num] => 2
)
[2] => Array
(
[num] => 1
)
)
想要的结果:
Array
(
[0] => Array
(
[paper_id] => 2
[student] => 小丸子
[subject] => 信息技术
[sj_title] => 信息考试
[paper_createtime] => 2015-10-14 13:39:08
[num] => 2
)
[1] => Array
(
[paper_id] => 2
[student] => 小丸子
[subject] => 信息技术
[sj_title] => 信息考试
[paper_createtime] => 2015-10-14 13:39:08
[num] => 1
)
)
试了数组合并array_merge_recursive 和array_merge貌似都不行,应该如何实现?
foreach($a as $key=>$val)
{
$a[$key]['num']=$b[$key]['num'];
}
array_push可以试试