我有以下两个arrays
,
$array1 = array
(
'Name' => 'Scott',
'Department' => 'Sales',
'Location' => 'USA',
'Details' => array
(
15 => '90%',
16 => '75%',
17 => '50%',
18 => '60%',
19 => '50%',
20 => '45%',
),
);
$array2 = array
(
'Action' => 'Imp',
'Name' => 'Scott',
'Department' => 'Sales',
'Location' => 'Canada',
'Details' => array
(
15 => '20%',
16 => '15%',
17 => '25%',
18 => '10%',
),
);
结果应该是:
$result_arr = array
(
'Action' => 'Imp',
'Name' => 'Scott',
'Department' => 'Sales',
'Location' => 'Canada',
'Details' => array
(
15 => '20%',
16 => '15%',
17 => '25%',
18 => '10%',
19 => '50%',
20 => '45%',
),
);
我试过了array_merge
,array union (+) operator
但没有一个适合我的要求。