Size Conversion


/ Published in: PHP
Save to your folder(s)

for converting size in proper format.


Copy this code and paste it in your HTML
  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. }

URL: http://dak9.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.