<?php
$array = array(
'66-507cddcd16d9786abafccfa78b19acf8' => 'XL',
'64-507cddcd16d9786abafccfa78b19acf8' => 'M',
'65-507cddcd16d9786abafccfa78b19acf8' => 'L',
'63-507cddcd16d9786abafccfa78b19acf8' => 'S'
);
function sizeSorter($a, $b) {
// customize as needed
$comp = array_flip(array('xxxs', 'xxs', 'xs', 's', 'small', 'm', 'medium', 'l', 'large', 'xl', 'xxl', 'xxxl'));
return $comp[strtolower($a)] - $comp[strtolower($b)];
}
uasort($array, 'sizeSorter');
print_r($array);