Let me give you an example solution, and then try to explain what I did:
<?php
$correct_order = array(
'Greybox',
'Browsie',
'Feelies',
'Manual',
'Disks',
'Folio',
'Mastertronic',
);
function cmp($a, $b) {
global $correct_order;
$a_index = array_search($a, $correct_order);
$b_index = array_search($b, $correct_order);
if($a_index < $b_index) return -1;
if($a_index > $b_index) return 1;
return 0;
}
$mixed_order = array(
'Disks',
'Mastertronic',
'Manual',
'Greybox',
'Feelies',
);
usort($mixed_order, 'cmp');
foreach($mixed_order as $v) echo "$v<br />\n";
?>
The usort function takes two arguments, the array to be sorted, and the name of the function that does the comparison. The comparison function ('cmp' in the example) is called repeatedly during the sort process. It needs to be able to compare any 2 elements of the array being sorted and determine a relationship between them. It must then return a value to reflect this relationship. If you're comparing two variables $a and $b, returning a -1 means that $a should come before $b. Returning 1 means $b should come before $a. If they're the same, return a 0.
In your case, you need a way to determine the intended order of the possible values. What I did was created a list in the correct order. This list is referenced as a global value in the cmp() function. For any compared element being passed in to the cmp function, it uses the array_search function to find the index of the element in the correct order. For example, 'Feelies' has an index of 2 in the correct order. 'Browsie' has an index of 1. If you did a cmp('Feelies', 'Browsie') it would return 1, since 'Browsie should come before 'Feelies'.
Hopefully that helps you. Let me know if I can clarify anything.