Witam!
Mam taki oto skrypt:
<?
function getfilesize($bytes) {
if ($bytes >= 1099511627776) {
$return = round($bytes / 1024
/ 1024
/ 1024
/ 1024
, 2
); $suffix = \"TB\";
} elseif ($bytes >= 1073741824) {
$return = round($bytes / 1024
/ 1024
/ 1024
, 2
); $suffix = \"GB\";
} elseif ($bytes >= 1048576) {
$return = round($bytes / 1024
/ 1024
, 2
); $suffix = \"MB\";
} elseif ($bytes >= 1024) {
$return = round($bytes / 1024
, 2
); $suffix = \"KB\";
} else {
$return = $bytes;
$suffix = \"Byte\";
}
if ($return == 1) {
$return .= \" \" . $suffix;
} else {
$return .= \" \" . $suffix . \"\";
}
return $return;
}
if ($_GET[\"path\"]==\"\") {
$path = \"./download\";
} else {
$path=$_GET[\"path\"];
}
echo \"<center><table width=100%><tr><td></td></tr>\";
while (false !== ($file = readdir($handle))) { if ($file != \".\" && $file != \"..\") {
if (is_dir(\"$path/$file\")==true){
$czas = date(\"d-m-Y\",filectime(\"$path/$file\"));
echo \"<tr><td><img src=./images/folder.gif /></td><td><a href=download.php?path=$path/$file>$file</a></td><td align=right></td><td align=right> $czas</td> </tr>\";
}else{
$wielkosc = getfilesize
(filesize(\"$path/$file\")); $czas = date(\"d-m-Y\",filectime(\"$path/$file\")); echo \"<tr><td><img src=./images/file.gif /></td><td><a href=$path/$file>$file</a></td><td align=right>$wielkosc</td><td align=right> $czas</td> </tr>\"; }
}
}
}
echo \"</table></center>\";
?>
...i pytanie co zrobic zeby sortowal pliki alfabetycznie?