File Size


 / Published in: PHP
 

  1. function file_size($file){
  2. $filesize = round((((int)$file)/1024)/1024,2);
  3. if($filesize >= 1) $filesize = $filesize."Mb";
  4. else $filesize = round((int)$file/1024,0)."Kb";
  5.  
  6. return $filesize;
  7. }

Report this snippet  

You need to login to post a comment.