and like us on FB

On a member-based site we operate we put a limit on the size of a directory before additional credit is required. The following function will recursively look through an entire directory and return a filesize. While the value returned is in bytes, you can alter it into a human readable string by using the first function from this article (“Return a Readable Filesize with PHP”).

The PHP Function

Usage is as follows:


Download: PHP Code (V)

Shortt URL for this post: