I have two arrays. array1 contains details of users and array2 has personal details. How do I merge array2 into array1 by using foreach reference?
$array1 = [
['id'=> 1,'name'=>'John Sena', 'lastname'=>'Jonn'],
['id'=> 2,'name'=>'Rock', 'lastname'=>'Rock Sena']
];
$array2 = [
['id'=>1, 'company'=>'Warner Brother'], ['id'=>2, 'company'=>'Metro'],['id'=>'1', 'Address'=>'USA']
];