Posted By

mukeshdak on 07/26/11


Tagged

mukeshdak filesizeconversion


Versions (?)

Size Conversion


 / Published in: PHP
 

URL: http://dak9.com

for converting size in proper format.

  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  

You need to login to post a comment.