Skip to content

Instantly share code, notes, and snippets.

View genakim's full-sized avatar

Gennadiy Kim genakim

  • Uzbekistan, Tashkent city
View GitHub Profile
@genakim
genakim / foldersize.php
Created June 28, 2021 06:03 — forked from eusonlito/foldersize.php
PHP function to get the folder size including subfolders
<?php
function folderSize ($dir)
{
$size = 0;
foreach (glob(rtrim($dir, '/').'/*', GLOB_NOSORT) as $each) {
$size += is_file($each) ? filesize($each) : folderSize($each);
}