|
|
|
@ -51,4 +51,26 @@ Class Html {
@@ -51,4 +51,26 @@ Class Html {
|
|
|
|
|
return $platform; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//根据ctime进行排序,默认按时间先后倒序排列 |
|
|
|
|
public static function sortFilesByCreateTime($files, $way = 'desc') { |
|
|
|
|
$ctimes = array(); |
|
|
|
|
foreach($files as $id => $item) { |
|
|
|
|
$ctimes[$id] = $item['fstat']['ctime']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($way == 'desc') { |
|
|
|
|
arsort($ctimes, SORT_NUMERIC); |
|
|
|
|
}else { |
|
|
|
|
asort($ctimes, SORT_NUMERIC); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$sorted = array(); |
|
|
|
|
|
|
|
|
|
foreach($ctimes as $id => $ctime) { |
|
|
|
|
array_push($sorted, $files[$id]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $sorted; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|