/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function get_file_size($file_size) { $range = 0; $size[0] = 'bytes'; $size[1] = 'kb'; $size[2] = 'mb'; $size[4] = 'gb'; $size[5] = 'tb'; while($file_size>1024){ $file_size = $file_size / 1024; $range++; } return $file_size.' '.$size[$range]; }