こんな感じで。(もとの配列を$orgとして、多次元配列$resultに)
foreach ($org as $key => $value)
$res[$val][] = $key;