PHP 8.5.0 Alpha 2 available for testing

Voting

: eight minus zero?
(Example: nine)

The Note You're Voting On

itsrool at gmail dot com
15 years ago
My solution for calculating the directory size:

<?php
/**
* Get the directory size
* @param directory $directory
* @return integer
*/
function dirSize($directory) {
$size = 0;
foreach(new
RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $file){
$size+=$file->getSize();
}
return
$size;
}
?>

<< Back to user notes page

To Top