function _addContinue($data)
    {
        $limit  = $this->_limit;
        $record = 0x003C;         // Record identifier

        // The first 2080/8224 bytes remain intact. However, we have to change
        // the length field of the record.
        $tmp = substr($data, 0, 2).pack("v", $limit-4).substr($data, 4, $limit - 4);

        $header = pack("vv", $record, $limit);  // Headers for continue records

        // Retrieve chunks of 2080/8224 bytes +4 for the header.
        $data_length = strlen($data);
        for ($i = $limit; $i <  ($data_length - $limit); $i += $limit) {
            $tmp .= $header;
            $tmp .= substr($data, $i, $limit);
        }

        // Retrieve the last chunk of data
        $header  = pack("vv", $record, strlen($data) - $i);
        $tmp    .= $header;
        $tmp    .= substr($data, $i, strlen($data) - $i);

        return $tmp;
    }
function _addContinue($data)
    {
        $limit  = $this->_limit;
        $record = 0x003C;         // Record identifier

        // The first 2080/8224 bytes remain intact. However, we have to change
        // the length field of the record.
        $tmp = substr($data, 0, 2).pack("v", $limit-4).substr($data, 4, $limit - 4);

        $header = pack("vv", $record, $limit);  // Headers for continue records

        // Retrieve chunks of 2080/8224 bytes +4 for the header.
        $data_length = strlen($data);
        for ($i = $limit; $i <  ($data_length - $limit); $i += $limit) {
            $tmp .= $header;
            $tmp .= substr($data, $i, $limit);
        }

        // Retrieve the last chunk of data
        $header  = pack("vv", $record, strlen($data) - $i);
        $tmp    .= $header;
        $tmp    .= substr($data, $i, strlen($data) - $i);

        return $tmp;
    }
function _addContinue ( $ data ) { $ limit = $ this -> _limit ; $ record = 0x003C ; // Record identifier // The first 2080/8224 bytes remain intact. However, we have to change // the length field of the record. $ tmp = substr ( $ data , 0 , 2 ) . pack ( "v" , $ limit - 4 ) . substr ( $ data , 4 , $ limit - 4 ) ; $ header = pack ( "vv" , $ record , $ limit ) ; // Headers for continue records // Retrieve chunks of 2080/8224 bytes +4 for the header. $ data_length = strlen ( $ data ) ; for ( $ i = $ limit ; $ i < ( $ data_length - $ limit ) ; $ i += $ limit ) { $ tmp .= $ header ; $ tmp .= substr ( $ data , $ i , $ limit ) ; } // Retrieve the last chunk of data $ header = pack ( "vv" , $ record , strlen ( $ data ) - $ i ) ; $ tmp .= $ header ; $ tmp .= substr ( $ data , $ i , strlen ( $ data ) - $ i ) ; return $ tmp ; }
Excel limits the size of BIFF records. In Excel 5 the limit is 2084 bytes. In
Excel 97 the limit is 8228 bytes. Records that are longer than these limits
must be split up into CONTINUE blocks.

This function takes a long BIFF record and inserts CONTINUE records as
necessary.

@param  string  $data The original binary data to be written
@return string        A very convenient string of continue blocks
@access private
Excel limits the size of BIFF records . In Excel 5 the limit is 2084 bytes . In Excel 97 the limit is 8228 bytes . Records that are longer than these limits must be split up into CONTINUE blocks .