public static function bytesToHumanReadableSize($size, $precision = 2)
    {
        for ($i = 0; ($size / 1024) > 0.9; $i++, $size /= 1024) {
        }

        return round($size, $precision).' '.['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'][$i];
    }
public static function bytesToHumanReadableSize($size, $precision = 2)
    {
        for ($i = 0; ($size / 1024) > 0.9; $i++, $size /= 1024) {
        }

        return round($size, $precision).' '.['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'][$i];
    }
public static function bytesToHumanReadableSize ( $ size , $ precision = 2 ) { for ( $ i = 0 ; ( $ size / 1024 ) > 0.9 ; $ i ++ , $ size /= 1024 ) { } return round ( $ size , $ precision ) . ' ' . [ 'B' , 'KB' , 'MB' , 'GB' , 'TB' , 'PB' , 'EB' , 'ZB' , 'YB' ] [ $ i ] ; }
Converts bytes to human readable size.

@method bytesToHumanReadableSize

@param int $size      Size in bytes
@param int $precision returned value precision

@return string Human readable size
Converts bytes to human readable size .