function foldersize($path) {
$total_size = 0;
$files = scandir($path);
foreach($files as $t) {
if (is_dir($t)) {
if ($t<>"." && $t<>"..") {
$size = foldersize($path . "/" . $t);
$total_size += $size;
}
}
else {
$size = filesize($path . "/" . $t);
print("File - $path/$t = $size<br>\n");
$total_size += $size;
}
}
return $total_size;
}// طريقة الاستدعاءecho foldersize("images");
$total_size = 0;
$files = scandir($path);
foreach($files as $t) {
if (is_dir($t)) {
if ($t<>"." && $t<>"..") {
$size = foldersize($path . "/" . $t);
$total_size += $size;
}
}
else {
$size = filesize($path . "/" . $t);
print("File - $path/$t = $size<br>\n");
$total_size += $size;
}
}
return $total_size;
}// طريقة الاستدعاءecho foldersize("images");
ليست هناك تعليقات:
إرسال تعليق