<?php
$countries = array(
0 => '-- SELECT --',
1 => 'Afghanistan',
2 => 'Albania',
3 => 'Algeria',
4 => 'American Samoa',
5 => 'Andorra',
22 => 'Canada',
44 => 'United States',);
$favourites = array(0, 44, 22);
$ordered = array();
foreach($favourites as $id)
{
$ordered[$id] = $countries[$id];
}
$ordered += array_diff_assoc($countries, $ordered);
print_r($ordered);