Ho provato così e sembra funzionare.... è corretto o è solo un caso?
Codice PHP:
$array_test_1 = array_csort($example_data,'1',SORT_DESC,'name');
$array_test_2 = array_csort($example_data,'2',SORT_DESC,'name');
function array_csort() { //coded by Ichier2003
$args = func_get_args();
$marray = array_shift($args);
$msortline = 'return(array_multisort(';
foreach ($args as $arg) {
$i++;
if (is_string($arg)) {
foreach ($marray as $row) {
$sortarr[$i][] = $row[$arg];
}
} else {
$sortarr[$i] = $arg;
}
$msortline .= '$sortarr['.$i.'],';
}
$msortline .= '$marray));';
eval($msortline);
return $marray;
}