you want to list a whole directory’s contents…
use the following function to list all files of the directory $url including filesize:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
function directoryList ($url) { $outp = ""; $d = dir($url); while($entry = $d->read()) { $size = round(filesize($url.$entry)/1024); if ($size > 999) $sizestring = ((round($size/100))/10)." mb"; else $sizestring = $size." kb"; $outp .= "<a href="https://www.iezzi.ch/wp-admin/%22.$url.$entry.%22">".$entry."</a> [ ".$sizestring." ] \n"; } $outp = "Path: ".$d->path." \n".$outp; $d->close(); return $outp; } |