I have below two arrays:
$a = [
['code' => '123', 'name' => 'ABC',],
['code' => '456', 'name' => 'XYZ',],
];
$b = [
['code' => '123', 'name' => 'ABC', 'price' => '34'],
['code' => '456', 'name' => 'PQR', 'price' => '56'],
['code' => '456', 'name' => 'XYZ', 'price' => '90'],
];
I want to create a third array where in the combination of code and name matches, like this:
$c = [
['code' => '123', 'name' => 'ABC', 'price' => '34'],
['code' => '456', 'name' => 'XYZ', 'price' => '90'],
]
I don't want the second row of $b
to be retained since the combination of code and name in that row does not match with a row in array $a