时间:2021-07-01 10:21:17 帮助过:2人阅读
/**
 * Returns a human readable filesize
 */
function HumanReadableFilesize($size) {
    $mod = 1024; 
    $units = explode(' ','B KB MB GB TB PB');
    for ($i = 0; $size > $mod; $i++) {
        $size /= $mod;
    }
    return round($size, 2) . ' ' . $units[$i];
}以上就是php 获取文件大小的方法实例代码的详细内容,更多请关注Gxl网其它相关文章!