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))));
    }