$name, 'size' => filesize($path), 'time' => filemtime($path), ]; } } } usort($files, fn($a, $b) => $b['time'] <=> $a['time']); function humanSize($bytes) { $units = ['B', 'KB', 'MB', 'GB']; $i = 0; while ($bytes >= 1024 && $i < count($units) - 1) { $bytes /= 1024; $i++; } return round($bytes, 2) . ' ' . $units[$i]; } ?>
| 文件名 | 大小 | 接收时间 | 操作 |
|---|---|---|---|
| = htmlspecialchars($f['name']) ?> | = humanSize($f['size']) ?> | = date('Y-m-d H:i:s', $f['time']) ?> |