PHP格式化文件大小,使bit值大小文件转换为KB、MB、GB、TB、PB单位的数值
/** * Returns a human readable filesize * * @author wesman20 (php.net) * @author Jonas John * @version 0.3 */ function HumanReadableFilesize($size) { // Adapted from: http://www.php.net/manual/en/function.filesize.php $mod = 1024; $units = explode(' ','B KB MB GB TB PB'); for ($i = 0; $size > $mod; $i++) { $size /= $mod; } return round($size, 2) . ' ' . $units[$i]; }
已抢66662个
抢已抢38041个
抢已抢21021个
抢已抢2644个
抢已抢116个
抢已抢19167个
抢