Is it possible in PHP to do something like this? How would you go about writing a function? Here is an example. The order is the most important thing.
$custo
There you go:
function sortArrayByArray(array $array, array $orderArray) { $ordered = array(); foreach ($orderArray as $key) { if (array_key_exists($key, $array)) { $ordered[$key] = $array[$key]; unset($array[$key]); } } return $ordered + $array; }