Jackthumper Posted November 25, 2010 Share Posted November 25, 2010 i need help gettig the size of a directory Link to comment https://forums.phpfreaks.com/topic/219827-how-do-i-get-the-size-of-a-directory/ Share on other sites More sharing options...
bugcoder Posted November 25, 2010 Share Posted November 25, 2010 found this soloution once <?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; } ?> Link to comment https://forums.phpfreaks.com/topic/219827-how-do-i-get-the-size-of-a-directory/#findComment-1139557 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.