Если это разовая операция можно и как-то так
$arr = array(array('id' => 1, 'year' => 2013, 'name' => "Александр"),
array('id' =>2, 'year' => 2013, 'name' => "Сергей"),
array('id' => 3, 'year' => 2012, 'name' => "Никита"),
array('id' => 4, 'year' => 2012, 'name' => "Володя"));
function group_by_year($arr) {
$newarr = array();
foreach($arr as $val) {
if (isset($newarr[$val['year']])) {
$index = 0;
while (1) {
if (!isset($newarr[$val['year']]['name'.$index]))
$newarr[$val['year']]['name'.$index] = $val['name'];
break;
$index++;
}
}
else {
$newarr[$val['year']] = $val;
unset($newarr[$val['year']]['year']);
}
}
return $newarr;
}
print_r(group_by_year($arr));