- uksort: documentation ( source)
<?php
$a = ['foo-test' => [1], '-' => [2], 'bar-test' => [3]];
uksort($a, function($x, $y) use (&$a) {
// global $a;
if (!isset($a[$x])) {
throw new Exception("$x");
}
if (!isset($a[$y])) {
throw new Exception("$y");
}
return $x < $y;
});