View Single Post
Old 12-21-2005, 06:20 AM   #9 (permalink)
morpheuz
Code Monkey
 
Join Date: Feb 2005
Posts: 64
morpheuz is on a distinguished road
Thanks redhead . The picture you made was crystal and left me with a no brainer on what to do. I worked out a solution that is much more sensible for me. I understand what the above post entails, and with all the circumvention required to do a simple task I need done, I just went in another direction completely. No need for the FTP.

Since I'm here, (I'd rather not create a new thread for one other question) maybe you guys can help me with this too... can anyone tell me how the below function works? It's not broken or anything I just can't understand it.

I got this off of php.net while looking up the filesize function. There were no definitive comments that came along with it and I'm just scratching my head at how log() operates (I didn't find the contributions to it in the manual helpful).

How does the below know to move to the next value in the array when the byte size warrants it?

PHP Code:
function human_file_size($size)
{
   
$filesizename = array(" Bytes"" KB"" MB"" GB"" TB"" PB"" EB"" ZB"" YB");
   return 
round($size/pow(1024, ($i floor(log($size1024)))), 2) . $filesizename[$i]; 
morpheuz is offline   Reply With Quote