попробуйте
$a = Array
(
'RX Housing' => Array
(
Array
(
'reg_id' => 63,
'vRegionName' => 'Boston',
'Forwarded' => 1,
'Accepted' => 0,
'Rejected' => 0,
'Dupe' => 0,
'PotentialLease' => 0,
'Lcpc' => 0,
'CloseLead' => 0,
'TotalInvamt' => 0.00
),
Array
(
'reg_id' => 41,
'vRegionName' => 'Chicago',
'Forwarded' => 1,
'Accepted' => 0,
'Rejected' => 0,
'Dupe' => 0,
'PotentialLease' => 0,
'Lcpc' => 0,
'CloseLead' => 1,
'TotalInvamt' => 954.00
)
)
);
$b = Array
(
'RX Housing' => Array
(
Array
(
'reg_id' => 63,
'TotalInv' => 2
),
Array
(
'reg_id' => 41,
'TotalInv' => 8
)
)
);
foreach ($a['RX Housing'] as $value) {
foreach ($b['RX Housing'] as $value1) {
foreach ($value as $key => $result) {
if (array_key_exists($key, $value1)) {
if ($result == $value1[$key]) {
$value = array_merge($value, $value1);
$c['RX Housing'][] = $value;
}
}
}
}
}
var_dump($c);
выход -
array
'RX Housing' =>
array
0 =>
array
'reg_id' => int 63
'vRegionName' => string 'Boston' (length=6)
'Forwarded' => int 1
'Accepted' => int 0
'Rejected' => int 0
'Dupe' => int 0
'PotentialLease' => int 0
'Lcpc' => int 0
'CloseLead' => int 0
'TotalInvamt' => float 0
'TotalInv' => int 2
1 =>
array
'reg_id' => int 41
'vRegionName' => string 'Chicago' (length=7)
'Forwarded' => int 1
'Accepted' => int 0
'Rejected' => int 0
'Dupe' => int 0
'PotentialLease' => int 0
'Lcpc' => int 0
'CloseLead' => int 1
'TotalInvamt' => float 954
'TotalInv' => int 8