$users = [
'Андрей 9',
'Василий 11',
'Роман 7',
'Андрей 6',
'Роман 11',
'Василий 6',
];
$temp = [];
foreach ($users as $user) {
$userData = explode(' ', $user);
$temp[$userData[0]][] = $userData[1];
}
foreach ($temp as $name => $item) {
echo sprintf('%s: %s<br/>', $name, implode(',', $item));
}