GIS Image Project


1024) { $current++; $bytes /= 1024; } return round($bytes,0)." ".$types[$current]; } $dir = @opendir(".") or die("Unable to open path"); // First, read the directory into an array so we can sort it. while (($file = readdir($dir)) !== false) { $dirlist[] = $file; } //Now sort the array and close the stream closedir($dir); sort($dirlist); //Now we can output it! echo "
\n"; while (list($key, $val) = each($dirlist)){ if ($val != "." && $val != ".." && $val != "index.php") { if (is_file($val)) { $size = fsize(filesize($val)); } else { //It should be a directory $val = $val . "/"; $size = " "; } echo '"; echo "\n"; } } echo "
'."$val$size
"; ?>