I’m trying to get the size of my website using php and ftp.
I would like to get the size of everything under httpdocs, (files and directories combined)
And have it output: My website is 42.5MB.
I’ve tried ftp_rawlist, but that gives me an ugly array that I have no idea how to parse. (Im new to php arrays). It also only gives me the file sizes of the files under httpdocs, not files within directories in httpdocs.
Is there some sort of recursive function that will do this?
Figured it out.
Anyway, here is what I wrote up to get this working.
Replace with your connection info: