Directory List With PHP
Join the DZone community and get the full member experience.
Join For Free// description of your code here
This code list all files and subdirectories in a dirctory with links.
ribafs.net - Tutoriais
http://ribafs.net -
$arquivo
";
}else{
$tamanho = filesize($arquivo);
$m = 'bytes';
if ($tamanho>1024) {
$tamanho=round($tamanho/1024,2);
$m = 'KB';
} elseif($tamanho > 1024*1024){
$tamanho = round(($tamanho/1024)/1024,2);
$m = 'MB';
}
$arq .= "
$arquivo - $tamanho $m
";
}
echo $dir . $arq;
closedir($dn);
?>
PHP
Directory
Opinions expressed by DZone contributors are their own.
Comments