Racking my brain on this, found many examples of similar situations however the solutions don\'t seem to match up.
I have two arrays being built as the result of SQL que
Assuming your first array as $first
and second array as $second
foreach ($first as $key => $each) {
foreach ($second as $secondeach) {
if($secondeach['sku'] == $key) {
$first[$key] = array_merge($first[$key], $secondeach);
// unset since you do not want LocalSKU value anymore.
unset($first[$key]['LocalSKU']);
}
}
}
$first
is your array you wanted.