Hi,
How do I open a directory using opendir(), loop through the files, and depending on the size of the folder, display the total size in KB, MB, GB, TB etc?
du /home/dysan
is probably easiest
or modify the below
if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { echo "filesize($file)"; } closedir($dh); } }
I'm new to file handling in PHP, can you give me a complete fully working example, so I can understand how it works?
no but i can point you to the manual php.net