public static function getReadableSize($bytes)
    {
        $unit = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
        $exp = floor(log($bytes, 1024)) | 0;

        return round($bytes / (pow(1024, $exp)), 2) . " $unit[$exp]";
    }
public static function getReadableSize($bytes)
    {
        $unit = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
        $exp = floor(log($bytes, 1024)) | 0;

        return round($bytes / (pow(1024, $exp)), 2) . " $unit[$exp]";
    }
public static function getReadableSize ( $ bytes ) { $ unit = [ 'B' , 'KB' , 'MB' , 'GB' , 'TB' , 'PB' , 'EB' , 'ZB' , 'YB' ] ; $ exp = floor ( log ( $ bytes , 1024 ) ) | 0 ; return round ( $ bytes / ( pow ( 1024 , $ exp ) ) , 2 ) . " $unit[$exp]" ; }
Get file size with correct extension

@param int $bytes
@return string
Get file size with correct extension