function sort_multi_array ($array, $key
{
$keys = array();
for ($i=1;$ifunc_num_args();$i++) {
$keys$i-1] = func_get_arg$i);
}
// create a custom search function to pass to usort
$func = function ($a, $b) use ($keys) {
for ($i=0;$icount$keys);$i++) {
if ($a$keys$i]] != $b$keys$i]]) {
return ($a$keys$i]] < $b$keys$i]]) ? -1 : 1;
}
}
return 0;
};
usort$array, $func);
return $array
}
eXorithm – Execute Algorithm: View / Run Algorithm sort_multi_array
