public static function readableFilesize($size, $precision = 2)
    {
        $result = $size;
        $index = 0;
        while ($result > 1024 && $index < count(self::$prefixes)) {
            $result = $result / 1024;
            $index++;
        }

        return sprintf('%1.'.$precision.'f %sB', $result, self::$prefixes[$index]);
    }
public static function readableFilesize($size, $precision = 2)
    {
        $result = $size;
        $index = 0;
        while ($result > 1024 && $index < count(self::$prefixes)) {
            $result = $result / 1024;
            $index++;
        }

        return sprintf('%1.'.$precision.'f %sB', $result, self::$prefixes[$index]);
    }
public static function readableFilesize ( $ size , $ precision = 2 ) { $ result = $ size ; $ index = 0 ; while ( $ result > 1024 && $ index < count ( self :: $ prefixes ) ) { $ result = $ result / 1024 ; $ index ++ ; } return sprintf ( '%1.' . $ precision . 'f %sB' , $ result , self :: $ prefixes [ $ index ] ) ; }
Tranformation to human-readable format
@param  int    $size      Size in bytes
@param  int    $precision Presicion of result (default 2)
@return string Transformed size
Tranformation to human - readable format