Serazovani muzes resit takto
// --- sort - multi colunm ---
function arraySortMulti(&$arr,$order=array())
{
$func_conv = function($s) {return (float) preg_replace('~[^.0-9]~',"", (string) $s);};
$func_sort = array(
'STRING' => function($a,$b){if ($a < $b) {return -1;}; if ($a > $b) {return 1;}; if ($a == $b) {return 0;}; return false;},
'STRNUM' => function($a,$b) use ($func_conv) {return $func_conv($a) - $func_conv($b);},
'NUMERIC' => function($a,$b){return $a - $b;}
);
$func_order = array(
'ASC' => function($q){return $q;},
'DESC' => function($q){return -$q;}
);
usort($arr, function ($a, $b) use ($order,$func_sort,$func_order)
{
$result = 0;
foreach ($order as $key => $value)
{
$o = isset($value['order']) && isset($func_order[$value['order']]) ? $func_order[$value['order']] : $func_order['ASC'];
$s = isset($value['sort']) && isset($func_sort[$value['sort']]) ? $func_sort[$value['sort']] : $func_sort['STRING'];
$result = $o($s($a[$key],$b[$key]));
if ($result!==0)
{
return $result;
}
}
return $result;
});
return $arr;
}
// ---
$order = array(
// 2 => array('order'=>'DESC','sort'=>'NUMERIC'),
1 => array('order'=>'DESC','sort'=>'STRNUM'),
0 => array('order'=>'ASC' ,'sort'=>'STRING')
);
$files = array(
array(0=> 'nazev', 1=> 'datum', 2=>'velikost')
)
arraySortMulti($files,$order);
Ty tam sice takove pole nemas, ale jiste si to svedes upravit pro tvuj pripad. Ze to treba explodujes podle _ a porovnas rok, mesic, den, hodinu - v tomto poradi
Nebo, proste muzes cyklem smazat rovnou :) opet pouzijes explode a porovnavas rok, mesic, den, hodin
Nebo, kdyz to mas serazene, tak to datum muzes najit rucne, ne? a vse nad nim smazes.
}