Posted By

DeadLy on 01/18/08


Tagged

convert


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

Nix
logankoester
Some0ne


Convert size in *KB, *MB, *GB ....


 / Published in: PHP
 

  1. function file_size($size)
  2. {
  3. $filesizename = array(" Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB");
  4. return $size ? round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $filesizename[$i] : '0 Bytes';
  5. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: virus_king on March 5, 2008

thanksZZzzZZZzzz....

Posted By: ideaza on October 20, 2009

thanks thanks ,Good

Posted By: udaydahale on November 20, 2010

hey that's not working properly man.........................................

plz help me

You need to login to post a comment.