I have two arrays of animals (for example).
$array = array( array( \'id\' => 1, \'name\' => \'Cat\', ), array( \'id
foreach ($array as $a) $new_array[$a['id']]['name'] = $a['name']; foreach ($array2 as $a) $new_array[$a['id']]['age'] = $a['age'];
and this is result:
[1] => Array ( [name] => Cat [age] => 123 ) [2] => Array ( [name] => Mouse [age] => 321 )