I have 2 different arrays
First is
(int) 0 => [
'id' => (int) 1,
'file_name' => 'test',
'imported_by' => 'John',
'valid_to' => (float) 1767225600000
],
(int) 1 => [
'id' => (int) 2,
'file_name' => null,
'imported_by' => 'John',
'valid_to' => (float) 1767225600000
],
Second one is
(int) 0 => object(App\Model\Entity\Product) {
'id' => (int) 1,
'product_cat' => (int) 10,
'product_type' => (int) 1,
'average....
I have to push first one into second one based on same key
it shoud look like this one
(int) 0 => object(App\Model\Entity\Product) {
'id' => (int) 1,
'product_category_id' => (int) 10,
'product_vessel_id' => (int) 1,
'average' => test;
//content from first array
'file_name' => 'test',
'imported_by' => 'John',
'valid_to' => (float) 1767225600000
I have tryied with array_merge_recursive($firstArray,$secondArray); but that mean adding elements on the end of firstArray