Voting

: three plus two?
(Example: nine)

The Note You're Voting On

marting.dc AT gmail.com
19 years ago
If you want to know a directory size, this function will help you:

<?php
function dir_size($dir)
{
$handle = opendir($dir);

while (
$file = readdir($handle)) {
if (
$file != '..' && $file != '.' && !is_dir($dir.'/'.$file)) {
$mas += filesize($dir.'/'.$file);
} else if (
is_dir($dir.'/'.$file) && $file != '..' && $file != '.') {
$mas += dir_size($dir.'/'.$file);
}
}
return
$mas;
}
echo
dir_size('DIRECTORIO').' Bytes';
?>

<< Back to user notes page

To Top