Iterate over the array, filling out another array.
PHP Code:
foreach ($source as $entry) {
$byType[$entry['type']][] = $entry;
}
var_export($byType);
/*Result:
array (
'x10' =>
array (
0 =>
array (
'link' => 'http://updated',
'type' => 'x10',
'vote' => 2,
),
1 =>
array (
'link' => 'http://paid',
'type' => 'x10',
'vote' => 3,
),
),
'hosting' =>
array (
0 =>
array (
'link' => 'http://latest',
'type' => 'hosting',
'vote' => 1,
),
1 =>
array (
'link' => 'http://free',
'type' => 'hosting',
'vote' => 5,
),
),
)
*/
Don't use 'link1', 'vote2' &c. as indices; use subarrays.