src/Helper/Helper.php
public static function formatByte($byte)
    {
        // ignore "Warning: Division by zero"
        if ($byte == 0) {
            return '0 B';
        }
        $s = array('B', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb');
        $e = floor(log($byte)/log(1024));
        return sprintf('%.2f '.$s[$e], ($byte/pow(1024, floor($e))));
    }
public static function formatByte($byte)
    {
        // ignore "Warning: Division by zero"
        if ($byte == 0) {
            return '0 B';
        }
        $s = array('B', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb');
        $e = floor(log($byte)/log(1024));
        return sprintf('%.2f '.$s[$e], ($byte/pow(1024, floor($e))));
    }
public static function formatByte ( $ byte ) { // ignore "Warning: Division by zero" if ( $ byte == 0 ) { return '0 B' ; } $ s = array ( 'B' , 'Kb' , 'Mb' , 'Gb' , 'Tb' , 'Pb' ) ; $ e = floor ( log ( $ byte ) / log ( 1024 ) ) ; return sprintf ( '%.2f ' . $ s [ $ e ] , ( $ byte / pow ( 1024 , floor ( $ e ) ) ) ) ; }
Format file size to human readable

@access public
@param int $byte byte of file size
@return strıng formatted file size
Format file size to human readable