\PhpOffice\PhpSpreadsheet\ReaderXls

Summary

Methods
Properties
Constants
__construct()
getReadDataOnly()
setReadDataOnly()
getReadEmptyCells()
setReadEmptyCells()
getIncludeCharts()
setIncludeCharts()
getLoadSheetsOnly()
setLoadSheetsOnly()
setLoadAllSheets()
getReadFilter()
setReadFilter()
getSecurityScanner()
canRead()
setCodepage()
listWorksheetNames()
listWorksheetInfo()
load()
getUInt2d()
getInt2d()
getInt4d()
No public properties found
XLS_BIFF8
XLS_BIFF7
XLS_WORKBOOKGLOBALS
XLS_WORKSHEET
XLS_TYPE_FORMULA
XLS_TYPE_EOF
XLS_TYPE_PROTECT
XLS_TYPE_OBJECTPROTECT
XLS_TYPE_SCENPROTECT
XLS_TYPE_PASSWORD
XLS_TYPE_HEADER
XLS_TYPE_FOOTER
XLS_TYPE_EXTERNSHEET
XLS_TYPE_DEFINEDNAME
XLS_TYPE_VERTICALPAGEBREAKS
XLS_TYPE_HORIZONTALPAGEBREAKS
XLS_TYPE_NOTE
XLS_TYPE_SELECTION
XLS_TYPE_DATEMODE
XLS_TYPE_EXTERNNAME
XLS_TYPE_LEFTMARGIN
XLS_TYPE_RIGHTMARGIN
XLS_TYPE_TOPMARGIN
XLS_TYPE_BOTTOMMARGIN
XLS_TYPE_PRINTGRIDLINES
XLS_TYPE_FILEPASS
XLS_TYPE_FONT
XLS_TYPE_CONTINUE
XLS_TYPE_PANE
XLS_TYPE_CODEPAGE
XLS_TYPE_DEFCOLWIDTH
XLS_TYPE_OBJ
XLS_TYPE_COLINFO
XLS_TYPE_IMDATA
XLS_TYPE_SHEETPR
XLS_TYPE_HCENTER
XLS_TYPE_VCENTER
XLS_TYPE_SHEET
XLS_TYPE_PALETTE
XLS_TYPE_SCL
XLS_TYPE_PAGESETUP
XLS_TYPE_MULRK
XLS_TYPE_MULBLANK
XLS_TYPE_DBCELL
XLS_TYPE_XF
XLS_TYPE_MERGEDCELLS
XLS_TYPE_MSODRAWINGGROUP
XLS_TYPE_MSODRAWING
XLS_TYPE_SST
XLS_TYPE_LABELSST
XLS_TYPE_EXTSST
XLS_TYPE_EXTERNALBOOK
XLS_TYPE_DATAVALIDATIONS
XLS_TYPE_TXO
XLS_TYPE_HYPERLINK
XLS_TYPE_DATAVALIDATION
XLS_TYPE_DIMENSION
XLS_TYPE_BLANK
XLS_TYPE_NUMBER
XLS_TYPE_LABEL
XLS_TYPE_BOOLERR
XLS_TYPE_STRING
XLS_TYPE_ROW
XLS_TYPE_INDEX
XLS_TYPE_ARRAY
XLS_TYPE_DEFAULTROWHEIGHT
XLS_TYPE_WINDOW2
XLS_TYPE_RK
XLS_TYPE_STYLE
XLS_TYPE_FORMAT
XLS_TYPE_SHAREDFMLA
XLS_TYPE_BOF
XLS_TYPE_SHEETPROTECTION
XLS_TYPE_RANGEPROTECTION
XLS_TYPE_SHEETLAYOUT
XLS_TYPE_XFEXT
XLS_TYPE_PAGELAYOUTVIEW
XLS_TYPE_UNKNOWN
MS_BIFF_CRYPTO_NONE
MS_BIFF_CRYPTO_XOR
MS_BIFF_CRYPTO_RC4
REKEY_BLOCK
openFile()
$readDataOnly
$readEmptyCells
$includeCharts
$loadSheetsOnly
$readFilter
$fileHandle
$securityScanner
N/A
readRecordData()
loadOLE()
readSummaryInformation()
readDocumentSummaryInformation()
readDefault()
readNote()
readTextObject()
readBof()
readFilepass()
makeKey()
verifyPassword()
readCodepage()
readDateMode()
readFont()
readFormat()
readXf()
readXfExt()
readStyle()
readPalette()
readSheet()
readExternalBook()
readExternName()
readExternSheet()
readDefinedName()
readMsoDrawingGroup()
readSst()
readPrintGridlines()
readDefaultRowHeight()
readSheetPr()
readHorizontalPageBreaks()
readVerticalPageBreaks()
readHeader()
readFooter()
readHcenter()
readVcenter()
readLeftMargin()
readRightMargin()
readTopMargin()
readBottomMargin()
readPageSetup()
readProtect()
readScenProtect()
readObjectProtect()
readPassword()
readDefColWidth()
readColInfo()
readRow()
readRk()
readLabelSst()
readMulRk()
readNumber()
readFormula()
readSharedFmla()
readString()
readBoolErr()
readMulBlank()
readLabel()
readBlank()
readMsoDrawing()
readObj()
readWindow2()
readPageLayoutView()
readScl()
readPane()
readSelection()
includeCellRangeFiltered()
readMergedCells()
readHyperLink()
readDataValidations()
readDataValidation()
readSheetLayout()
readSheetProtection()
readRangeProtection()
readContinue()
getSplicedRecordData()
getFormulaFromStructure()
getFormulaFromData()
createFormulaFromTokens()
getNextToken()
readBIFF8CellAddress()
readBIFF8CellAddressB()
readBIFF5CellRangeAddressFixed()
readBIFF8CellRangeAddressFixed()
readBIFF8CellRangeAddress()
readBIFF8CellRangeAddressB()
readBIFF8CellRangeAddressList()
readBIFF5CellRangeAddressList()
readSheetRangeByRefIndex()
readBIFF8ConstantArray()
readBIFF8Constant()
readRGB()
readByteStringShort()
readByteStringLong()
readUnicodeStringShort()
readUnicodeStringLong()
readUnicodeString()
UTF8toExcelDoubleQuoted()
extractNumber()
getIEEE754()
encodeUTF16()
uncompressByteString()
decodeCodepage()
parseRichText()
$summaryInformation
$documentSummaryInformation
$data
$dataSize
$pos
$spreadsheet
$phpSheet
$version
$codepage
$formats
$objFonts
$palette
$sheets
$externalBooks
$ref
$externalNames
$definedname
$sst
$frozen
$isFitToPages
$objs
$textObjects
$cellNotes
$drawingGroupData
$drawingData
$xfIndex
$mapCellXfIndex
$mapCellStyleXfIndex
$sharedFormulas
$sharedFormulaParts
$encryption
$encryptionStartPos
$rc4Key
$rc4Pos
$md5Ctxt
$textObjRef
$baseCell
N/A

Constants

XLS_BIFF8

XLS_BIFF8 = 0x600

XLS_BIFF7

XLS_BIFF7 = 0x500

XLS_WORKBOOKGLOBALS

XLS_WORKBOOKGLOBALS = 0x5

XLS_WORKSHEET

XLS_WORKSHEET = 0x10

XLS_TYPE_FORMULA

XLS_TYPE_FORMULA = 0x6

XLS_TYPE_EOF

XLS_TYPE_EOF = 0xa

XLS_TYPE_PROTECT

XLS_TYPE_PROTECT = 0x12

XLS_TYPE_OBJECTPROTECT

XLS_TYPE_OBJECTPROTECT = 0x63

XLS_TYPE_SCENPROTECT

XLS_TYPE_SCENPROTECT = 0xdd

XLS_TYPE_PASSWORD

XLS_TYPE_PASSWORD = 0x13

XLS_TYPE_HEADER

XLS_TYPE_HEADER = 0x14

XLS_TYPE_EXTERNSHEET

XLS_TYPE_EXTERNSHEET = 0x17

XLS_TYPE_DEFINEDNAME

XLS_TYPE_DEFINEDNAME = 0x18

XLS_TYPE_VERTICALPAGEBREAKS

XLS_TYPE_VERTICALPAGEBREAKS = 0x1a

XLS_TYPE_HORIZONTALPAGEBREAKS

XLS_TYPE_HORIZONTALPAGEBREAKS = 0x1b

XLS_TYPE_NOTE

XLS_TYPE_NOTE = 0x1c

XLS_TYPE_SELECTION

XLS_TYPE_SELECTION = 0x1d

XLS_TYPE_DATEMODE

XLS_TYPE_DATEMODE = 0x22

XLS_TYPE_EXTERNNAME

XLS_TYPE_EXTERNNAME = 0x23

XLS_TYPE_LEFTMARGIN

XLS_TYPE_LEFTMARGIN = 0x26

XLS_TYPE_RIGHTMARGIN

XLS_TYPE_RIGHTMARGIN = 0x27

XLS_TYPE_TOPMARGIN

XLS_TYPE_TOPMARGIN = 0x28

XLS_TYPE_BOTTOMMARGIN

XLS_TYPE_BOTTOMMARGIN = 0x29

XLS_TYPE_PRINTGRIDLINES

XLS_TYPE_PRINTGRIDLINES = 0x2b

XLS_TYPE_FILEPASS

XLS_TYPE_FILEPASS = 0x2f

XLS_TYPE_FONT

XLS_TYPE_FONT = 0x31

XLS_TYPE_CONTINUE

XLS_TYPE_CONTINUE = 0x3c

XLS_TYPE_PANE

XLS_TYPE_PANE = 0x41

XLS_TYPE_CODEPAGE

XLS_TYPE_CODEPAGE = 0x42

XLS_TYPE_DEFCOLWIDTH

XLS_TYPE_DEFCOLWIDTH = 0x55

XLS_TYPE_OBJ

XLS_TYPE_OBJ = 0x5d

XLS_TYPE_COLINFO

XLS_TYPE_COLINFO = 0x7d

XLS_TYPE_IMDATA

XLS_TYPE_IMDATA = 0x7f

XLS_TYPE_SHEETPR

XLS_TYPE_SHEETPR = 0x81

XLS_TYPE_HCENTER

XLS_TYPE_HCENTER = 0x83

XLS_TYPE_VCENTER

XLS_TYPE_VCENTER = 0x84

XLS_TYPE_SHEET

XLS_TYPE_SHEET = 0x85

XLS_TYPE_PALETTE

XLS_TYPE_PALETTE = 0x92

XLS_TYPE_SCL

XLS_TYPE_SCL = 0xa0

XLS_TYPE_PAGESETUP

XLS_TYPE_PAGESETUP = 0xa1

XLS_TYPE_MULRK

XLS_TYPE_MULRK = 0xbd

XLS_TYPE_MULBLANK

XLS_TYPE_MULBLANK = 0xbe

XLS_TYPE_DBCELL

XLS_TYPE_DBCELL = 0xd7

XLS_TYPE_XF

XLS_TYPE_XF = 0xe0

XLS_TYPE_MERGEDCELLS

XLS_TYPE_MERGEDCELLS = 0xe5

XLS_TYPE_MSODRAWINGGROUP

XLS_TYPE_MSODRAWINGGROUP = 0xeb

XLS_TYPE_MSODRAWING

XLS_TYPE_MSODRAWING = 0xec

XLS_TYPE_SST

XLS_TYPE_SST = 0xfc

XLS_TYPE_LABELSST

XLS_TYPE_LABELSST = 0xfd

XLS_TYPE_EXTSST

XLS_TYPE_EXTSST = 0xff

XLS_TYPE_EXTERNALBOOK

XLS_TYPE_EXTERNALBOOK = 0x1ae

XLS_TYPE_DATAVALIDATIONS

XLS_TYPE_DATAVALIDATIONS = 0x1b2

XLS_TYPE_TXO

XLS_TYPE_TXO = 0x1b6

XLS_TYPE_DATAVALIDATION

XLS_TYPE_DATAVALIDATION = 0x1be

XLS_TYPE_DIMENSION

XLS_TYPE_DIMENSION = 0x200

XLS_TYPE_BLANK

XLS_TYPE_BLANK = 0x201

XLS_TYPE_NUMBER

XLS_TYPE_NUMBER = 0x203

XLS_TYPE_LABEL

XLS_TYPE_LABEL = 0x204

XLS_TYPE_BOOLERR

XLS_TYPE_BOOLERR = 0x205

XLS_TYPE_STRING

XLS_TYPE_STRING = 0x207

XLS_TYPE_ROW

XLS_TYPE_ROW = 0x208

XLS_TYPE_INDEX

XLS_TYPE_INDEX = 0x20b

XLS_TYPE_ARRAY

XLS_TYPE_ARRAY = 0x221

XLS_TYPE_DEFAULTROWHEIGHT

XLS_TYPE_DEFAULTROWHEIGHT = 0x225

XLS_TYPE_WINDOW2

XLS_TYPE_WINDOW2 = 0x23e

XLS_TYPE_RK

XLS_TYPE_RK = 0x27e

XLS_TYPE_STYLE

XLS_TYPE_STYLE = 0x293

XLS_TYPE_FORMAT

XLS_TYPE_FORMAT = 0x41e

XLS_TYPE_SHAREDFMLA

XLS_TYPE_SHAREDFMLA = 0x4bc

XLS_TYPE_BOF

XLS_TYPE_BOF = 0x809

XLS_TYPE_SHEETPROTECTION

XLS_TYPE_SHEETPROTECTION = 0x867

XLS_TYPE_RANGEPROTECTION

XLS_TYPE_RANGEPROTECTION = 0x868

XLS_TYPE_SHEETLAYOUT

XLS_TYPE_SHEETLAYOUT = 0x862

XLS_TYPE_XFEXT

XLS_TYPE_XFEXT = 0x87d

XLS_TYPE_PAGELAYOUTVIEW

XLS_TYPE_PAGELAYOUTVIEW = 0x88b

XLS_TYPE_UNKNOWN

XLS_TYPE_UNKNOWN = 0xffff

MS_BIFF_CRYPTO_NONE

MS_BIFF_CRYPTO_NONE = 0

MS_BIFF_CRYPTO_XOR

MS_BIFF_CRYPTO_XOR = 1

MS_BIFF_CRYPTO_RC4

MS_BIFF_CRYPTO_RC4 = 2

REKEY_BLOCK

REKEY_BLOCK = 0x400

Properties

$readDataOnly

$readDataOnly : bool

Read data only? Identifies whether the Reader should only read data values for cells, and ignore any formatting information; or whether it should read both data and formatting.

Type

bool

$readEmptyCells

$readEmptyCells : bool

Read empty cells? Identifies whether the Reader should read data values for cells all cells, or should ignore cells containing null value or empty string.

Type

bool

$includeCharts

$includeCharts : bool

Read charts that are defined in the workbook? Identifies whether the Reader should read the definitions for any charts that exist in the workbook;.

Type

bool

$loadSheetsOnly

$loadSheetsOnly : array

Restrict which sheets should be loaded? This property holds an array of worksheet names to be loaded. If null, then all worksheets will be loaded.

Type

array — of string

$readFilter

$readFilter : \PhpOffice\PhpSpreadsheet\Reader\IReadFilter

IReadFilter instance.

Type

IReadFilter

$fileHandle

$fileHandle

$securityScanner

$securityScanner : \PhpOffice\PhpSpreadsheet\Reader\Security\XmlScanner

Type

XmlScanner

$summaryInformation

$summaryInformation : string

Summary Information stream data.

Type

string

$documentSummaryInformation

$documentSummaryInformation : string

Extended Summary Information stream data.

Type

string

$data

$data : string

Workbook stream data. (Includes workbook globals substream as well as sheet substreams).

Type

string

$dataSize

$dataSize : int

Size in bytes of $this->data.

Type

int

$pos

$pos : int

Current position in stream.

Type

int

$spreadsheet

$spreadsheet : \PhpOffice\PhpSpreadsheet\Spreadsheet

Workbook to be returned by the reader.

Type

Spreadsheet

$phpSheet

$phpSheet : \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet

Worksheet that is currently being built by the reader.

Type

Worksheet

$version

$version : int

BIFF version.

Type

int

$codepage

$codepage : string

Codepage set in the Excel file being read. Only important for BIFF5 (Excel 5.0 - Excel 95) For BIFF8 (Excel 97 - Excel 2003) this will always have the value 'UTF-16LE'.

Type

string

$formats

$formats : array

Shared formats.

Type

array

$objFonts

$objFonts : array

Shared fonts.

Type

array

$palette

$palette : array

Color palette.

Type

array

$sheets

$sheets : array

Worksheets.

Type

array

$externalBooks

$externalBooks : array

External books.

Type

array

$ref

$ref : array

REF structures. Only applies to BIFF8.

Type

array

$externalNames

$externalNames : array

External names.

Type

array

$definedname

$definedname : array

Defined names.

Type

array

$sst

$sst : array

Shared strings. Only applies to BIFF8.

Type

array

$frozen

$frozen : bool

Panes are frozen? (in sheet currently being read). See WINDOW2 record.

Type

bool

$isFitToPages

$isFitToPages : bool

Fit printout to number of pages? (in sheet currently being read). See SHEETPR record.

Type

bool

$objs

$objs : array

Objects. One OBJ record contributes with one entry.

Type

array

$textObjects

$textObjects : array

Text Objects. One TXO record corresponds with one entry.

Type

array

$cellNotes

$cellNotes : array

Cell Annotations (BIFF8).

Type

array

$drawingGroupData

$drawingGroupData : string

The combined MSODRAWINGGROUP data.

Type

string

$drawingData

$drawingData : string

The combined MSODRAWING data (per sheet).

Type

string

$xfIndex

$xfIndex : int

Keep track of XF index.

Type

int

$mapCellXfIndex

$mapCellXfIndex : array

Mapping of XF index (that is a cell XF) to final index in cellXf collection.

Type

array

$mapCellStyleXfIndex

$mapCellStyleXfIndex : array

Mapping of XF index (that is a style XF) to final index in cellStyleXf collection.

Type

array

$sharedFormulas

$sharedFormulas : array

The shared formulas in a sheet. One SHAREDFMLA record contributes with one value.

Type

array

$sharedFormulaParts

$sharedFormulaParts : array

The shared formula parts in a sheet. One FORMULA record contributes with one value if it refers to a shared formula.

Type

array

$encryption

$encryption : int

The type of encryption in use.

Type

int

$encryptionStartPos

$encryptionStartPos : int

The position in the stream after which contents are encrypted.

Type

int

$rc4Key

$rc4Key : \PhpOffice\PhpSpreadsheet\Reader\Xls\RC4

The current RC4 decryption object.

Type

RC4

$rc4Pos

$rc4Pos : int

The position in the stream that the RC4 decryption object was left at.

Type

int

$md5Ctxt

$md5Ctxt : string

The current MD5 context state.

Type

string

$textObjRef

$textObjRef : int

Type

int

$baseCell

$baseCell : string

Type

string

Methods

__construct()

__construct() : mixed

Create a new Xls Reader instance.

Returns

mixed —

getReadDataOnly()

getReadDataOnly() : bool

Read data only? If this is true, then the Reader will only read data values for cells, it will not read any formatting information.

If false (the default) it will read data and formatting.

Returns

bool —

setReadDataOnly()

setReadDataOnly(mixed  $pValue) : \PhpOffice\PhpSpreadsheet\Reader\IReader

Set read data only Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information.

Set to false (the default) to advise the Reader to read both data and formatting for cells.

Parameters

mixed $pValue

Returns

\PhpOffice\PhpSpreadsheet\Reader\IReader —

getReadEmptyCells()

getReadEmptyCells() : bool

Read empty cells? If this is true (the default), then the Reader will read data values for all cells, irrespective of value.

If false it will not read data for cells containing a null value or an empty string.

Returns

bool —

setReadEmptyCells()

setReadEmptyCells(mixed  $pValue) : \PhpOffice\PhpSpreadsheet\Reader\IReader

Set read empty cells Set to true (the default) to advise the Reader read data values for all cells, irrespective of value.

Set to false to advise the Reader to ignore cells containing a null value or an empty string.

Parameters

mixed $pValue

Returns

\PhpOffice\PhpSpreadsheet\Reader\IReader —

getIncludeCharts()

getIncludeCharts() : bool

Read charts in workbook? If this is true, then the Reader will include any charts that exist in the workbook.

Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. If false (the default) it will ignore any charts defined in the workbook file.

Returns

bool —

setIncludeCharts()

setIncludeCharts(mixed  $pValue) : \PhpOffice\PhpSpreadsheet\Reader\IReader

Set read charts in workbook Set to true, to advise the Reader to include any charts that exist in the workbook.

Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. Set to false (the default) to discard charts.

Parameters

mixed $pValue

Returns

\PhpOffice\PhpSpreadsheet\Reader\IReader —

getLoadSheetsOnly()

getLoadSheetsOnly() : mixed

Get which sheets to load Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null indicating that all worksheets in the workbook should be loaded.

Returns

mixed —

setLoadSheetsOnly()

setLoadSheetsOnly(mixed  $value) : \PhpOffice\PhpSpreadsheet\Reader\IReader

Set which sheets to load.

Parameters

mixed $value

This should be either an array of worksheet names to be loaded, or a string containing a single worksheet name. If NULL, then it tells the Reader to read all worksheets in the workbook

Returns

\PhpOffice\PhpSpreadsheet\Reader\IReader —

setLoadAllSheets()

setLoadAllSheets() : \PhpOffice\PhpSpreadsheet\Reader\IReader

Set all sheets to load Tells the Reader to load all worksheets from the workbook.

Returns

\PhpOffice\PhpSpreadsheet\Reader\IReader —

getReadFilter()

getReadFilter() : \PhpOffice\PhpSpreadsheet\Reader\IReadFilter

Read filter.

Returns

\PhpOffice\PhpSpreadsheet\Reader\IReadFilter —

setReadFilter()

setReadFilter(\PhpOffice\PhpSpreadsheet\Reader\IReadFilter  $pValue) : \PhpOffice\PhpSpreadsheet\Reader\IReader

Set read filter.

Parameters

\PhpOffice\PhpSpreadsheet\Reader\IReadFilter $pValue

Returns

\PhpOffice\PhpSpreadsheet\Reader\IReader —

getSecurityScanner()

getSecurityScanner() : mixed

Returns

mixed —

canRead()

canRead(string  $pFilename) : bool

Can the current IReader read the file?

Parameters

string $pFilename

Returns

bool —

setCodepage()

setCodepage(string  $codepage) : void

Parameters

string $codepage

listWorksheetNames()

listWorksheetNames(string  $pFilename) : array

Reads names of the worksheets from a file, without parsing the whole file to a PhpSpreadsheet object.

Parameters

string $pFilename

Returns

array —

listWorksheetInfo()

listWorksheetInfo(string  $pFilename) : array

Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).

Parameters

string $pFilename

Returns

array —

load()

load(string  $pFilename) : \PhpOffice\PhpSpreadsheet\Spreadsheet

Loads PhpSpreadsheet from file.

Parameters

string $pFilename

Returns

\PhpOffice\PhpSpreadsheet\Spreadsheet —

getUInt2d()

getUInt2d(string  $data, int  $pos) : int

Read 16-bit unsigned integer.

Parameters

string $data
int $pos

Returns

int —

getInt2d()

getInt2d(string  $data, int  $pos) : int

Read 16-bit signed integer.

Parameters

string $data
int $pos

Returns

int —

getInt4d()

getInt4d(string  $data, int  $pos) : int

Read 32-bit signed integer.

Parameters

string $data
int $pos

Returns

int —

openFile()

openFile(string  $pFilename) : void

Open file for reading.

Parameters

string $pFilename

readRecordData()

readRecordData(string  $data, int  $pos, int  $len) : string

Read record data from stream, decrypting as required.

Parameters

string $data

Data stream to read from

int $pos

Position to start reading from

int $len

Record data length

Returns

string —

Record data

loadOLE()

loadOLE(string  $pFilename) : void

Use OLE reader to extract the relevant data streams from the OLE file.

Parameters

string $pFilename

readSummaryInformation()

readSummaryInformation() : void

Read summary information.

readDocumentSummaryInformation()

readDocumentSummaryInformation() : void

Read additional document summary information.

readDefault()

readDefault() : void

Reads a general type of BIFF record. Does nothing except for moving stream pointer forward to next record.

readNote()

readNote() : void

The NOTE record specifies a comment associated with a particular cell. In Excel 95 (BIFF7) and earlier versions, this record stores a note (cell note). This feature was significantly enhanced in Excel 97.

readTextObject()

readTextObject() : void

The TEXT Object record contains the text associated with a cell annotation.

readBof()

readBof() : void

Read BOF.

readFilepass()

readFilepass() : void

FILEPASS.

This record is part of the File Protection Block. It contains information about the read/write password of the file. All record contents following this record will be encrypted.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

The decryption functions and objects used from here on in are based on the source of Spreadsheet-ParseExcel: https://metacpan.org/release/Spreadsheet-ParseExcel

makeKey()

makeKey(int  $block, string  $valContext) : \PhpOffice\PhpSpreadsheet\Reader\Xls\RC4

Make an RC4 decryptor for the given block.

Parameters

int $block

Block for which to create decrypto

string $valContext

MD5 context state

Returns

\PhpOffice\PhpSpreadsheet\Reader\Xls\RC4 —

verifyPassword()

verifyPassword(string  $password, string  $docid, string  $salt_data, string  $hashedsalt_data, string  $valContext) : bool

Verify RC4 file password.

Parameters

string $password

Password to check

string $docid

Document id

string $salt_data

Salt data

string $hashedsalt_data

Hashed salt data

string $valContext

Set to the MD5 context of the value

Returns

bool —

Success

readCodepage()

readCodepage() : void

CODEPAGE.

This record stores the text encoding used to write byte strings, stored as MS Windows code page identifier.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

readDateMode()

readDateMode() : void

DATEMODE.

This record specifies the base date for displaying date values. All dates are stored as count of days past this base date. In BIFF2-BIFF4 this record is part of the Calculation Settings Block. In BIFF5-BIFF8 it is stored in the Workbook Globals Substream.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

readFont()

readFont() : void

Read a FONT record.

readFormat()

readFormat() : void

FORMAT.

This record contains information about a number format. All FORMAT records occur together in a sequential list.

In BIFF2-BIFF4 other records referencing a FORMAT record contain a zero-based index into this list. From BIFF5 on the FORMAT record contains the index itself that will be used by other records.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

readXf()

readXf() : void

XF - Extended Format.

This record contains formatting information for cells, rows, columns or styles. According to https://support.microsoft.com/en-us/help/147732 there are always at least 15 cell style XF and 1 cell XF. Inspection of Excel files generated by MS Office Excel shows that XF records 0-14 are cell style XF and XF record 15 is a cell XF We only read the first cell style XF and skip the remaining cell style XF records We read all cell XF records.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

readXfExt()

readXfExt() : void

readStyle()

readStyle() : void

Read STYLE record.

readPalette()

readPalette() : void

Read PALETTE record.

readSheet()

readSheet() : void

SHEET.

This record is located in the Workbook Globals Substream and represents a sheet inside the workbook. One SHEET record is written for each sheet. It stores the sheet name and a stream offset to the BOF record of the respective Sheet Substream within the Workbook Stream.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

readExternalBook()

readExternalBook() : void

Read EXTERNALBOOK record.

readExternName()

readExternName() : void

Read EXTERNNAME record.

readExternSheet()

readExternSheet() : void

Read EXTERNSHEET record.

readDefinedName()

readDefinedName() : void

DEFINEDNAME.

This record is part of a Link Table. It contains the name and the token array of an internal defined name. Token arrays of defined names contain tokens with aberrant token classes.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

readMsoDrawingGroup()

readMsoDrawingGroup() : void

Read MSODRAWINGGROUP record.

readSst()

readSst() : void

SST - Shared String Table.

This record contains a list of all strings used anywhere in the workbook. Each string occurs only once. The workbook uses indexes into the list to reference the strings.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

readPrintGridlines()

readPrintGridlines() : void

Read PRINTGRIDLINES record.

readDefaultRowHeight()

readDefaultRowHeight() : void

Read DEFAULTROWHEIGHT record.

readSheetPr()

readSheetPr() : void

Read SHEETPR record.

readHorizontalPageBreaks()

readHorizontalPageBreaks() : void

Read HORIZONTALPAGEBREAKS record.

readVerticalPageBreaks()

readVerticalPageBreaks() : void

Read VERTICALPAGEBREAKS record.

readHeader()

readHeader() : void

Read HEADER record.

readFooter()

readFooter() : void

Read FOOTER record.

readHcenter()

readHcenter() : void

Read HCENTER record.

readVcenter()

readVcenter() : void

Read VCENTER record.

readLeftMargin()

readLeftMargin() : void

Read LEFTMARGIN record.

readRightMargin()

readRightMargin() : void

Read RIGHTMARGIN record.

readTopMargin()

readTopMargin() : void

Read TOPMARGIN record.

readBottomMargin()

readBottomMargin() : void

Read BOTTOMMARGIN record.

readPageSetup()

readPageSetup() : void

Read PAGESETUP record.

readProtect()

readProtect() : void

PROTECT - Sheet protection (BIFF2 through BIFF8) if this record is omitted, then it also means no sheet protection.

readScenProtect()

readScenProtect() : void

SCENPROTECT.

readObjectProtect()

readObjectProtect() : void

OBJECTPROTECT.

readPassword()

readPassword() : void

PASSWORD - Sheet protection (hashed) password (BIFF2 through BIFF8).

readDefColWidth()

readDefColWidth() : void

Read DEFCOLWIDTH record.

readColInfo()

readColInfo() : void

Read COLINFO record.

readRow()

readRow() : void

ROW.

This record contains the properties of a single row in a sheet. Rows and cells in a sheet are divided into blocks of 32 rows.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

readRk()

readRk() : void

Read RK record This record represents a cell that contains an RK value (encoded integer or floating-point value). If a floating-point value cannot be encoded to an RK value, a NUMBER record will be written. This record replaces the record INTEGER written in BIFF2.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

readLabelSst()

readLabelSst() : void

Read LABELSST record This record represents a cell that contains a string. It replaces the LABEL record and RSTRING record used in BIFF2-BIFF5.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

readMulRk()

readMulRk() : void

Read MULRK record This record represents a cell range containing RK value cells. All cells are located in the same row.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

readNumber()

readNumber() : void

Read NUMBER record This record represents a cell that contains a floating-point value.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

readFormula()

readFormula() : void

Read FORMULA record + perhaps a following STRING record if formula result is a string This record contains the token array and the result of a formula cell.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

readSharedFmla()

readSharedFmla() : void

Read a SHAREDFMLA record. This function just stores the binary shared formula in the reader, which usually contains relative references.

These will be used to construct the formula in each shared formula part after the sheet is read.

readString()

readString() : string

Read a STRING record from current stream position and advance the stream pointer to next record This record is used for storing result from FORMULA record when it is a string, and it occurs directly after the FORMULA record.

Returns

string —

The string contents as UTF-8

readBoolErr()

readBoolErr() : void

Read BOOLERR record This record represents a Boolean value or error value cell.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

readMulBlank()

readMulBlank() : void

Read MULBLANK record This record represents a cell range of empty cells. All cells are located in the same row.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

readLabel()

readLabel() : void

Read LABEL record This record represents a cell that contains a string. In BIFF8 it is usually replaced by the LABELSST record.

Excel still uses this record, if it copies unformatted text cells to the clipboard.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

readBlank()

readBlank() : void

Read BLANK record.

readMsoDrawing()

readMsoDrawing() : void

Read MSODRAWING record.

readObj()

readObj() : void

Read OBJ record.

readWindow2()

readWindow2() : void

Read WINDOW2 record.

readPageLayoutView()

readPageLayoutView() : void

Read PLV Record(Created by Excel2007 or upper).

readScl()

readScl() : void

Read SCL record.

readPane()

readPane() : void

Read PANE record.

readSelection()

readSelection() : void

Read SELECTION record. There is one such record for each pane in the sheet.

includeCellRangeFiltered()

includeCellRangeFiltered(mixed  $cellRangeAddress) : mixed

Parameters

mixed $cellRangeAddress

Returns

mixed —

readMergedCells()

readMergedCells() : void

MERGEDCELLS.

This record contains the addresses of merged cell ranges in the current sheet.

-- "OpenOffice.org's Documentation of the Microsoft Excel File Format"

readHyperLink()

readHyperLink() : void

Read HYPERLINK record.

readDataValidations()

readDataValidations() : void

Read DATAVALIDATIONS record.

readDataValidation()

readDataValidation() : void

Read DATAVALIDATION record.

readSheetLayout()

readSheetLayout() : void

Read SHEETLAYOUT record. Stores sheet tab color information.

readSheetProtection()

readSheetProtection() : void

Read SHEETPROTECTION record (FEATHEADR).

readRangeProtection()

readRangeProtection() : void

Read RANGEPROTECTION record Reading of this record is based on Microsoft Office Excel 97-2000 Binary File Format Specification, where it is referred to as FEAT record.

readContinue()

readContinue() : void

Read a free CONTINUE record. Free CONTINUE record may be a camouflaged MSODRAWING record When MSODRAWING data on a sheet exceeds 8224 bytes, CONTINUE records are used instead. Undocumented.

In this case, we must treat the CONTINUE record as a MSODRAWING record.

getSplicedRecordData()

getSplicedRecordData() : array

Reads a record from current position in data stream and continues reading data as long as CONTINUE records are found. Splices the record data pieces and returns the combined string as if record data is in one piece.

Moves to next current position in data stream to start of next record different from a CONtINUE record.

Returns

array —

getFormulaFromStructure()

getFormulaFromStructure(string  $formulaStructure, string  $baseCell = 'A1') : string

Convert formula structure into human readable Excel formula like 'A3+A5*5'.

Parameters

string $formulaStructure

The complete binary data for the formula

string $baseCell

Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas

Returns

string —

Human readable formula

getFormulaFromData()

getFormulaFromData(string  $formulaData, string  $additionalData = '', string  $baseCell = 'A1') : string

Take formula data and additional data for formula and return human readable formula.

Parameters

string $formulaData

The binary data for the formula itself

string $additionalData

Additional binary data going with the formula

string $baseCell

Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas

Returns

string —

Human readable formula

createFormulaFromTokens()

createFormulaFromTokens(array  $tokens, string  $additionalData) : string

Take array of tokens together with additional data for formula and return human readable formula.

Parameters

array $tokens
string $additionalData

Additional binary data going with the formula

Returns

string —

Human readable formula

getNextToken()

getNextToken(string  $formulaData, string  $baseCell = 'A1') : array

Fetch next token from binary formula data.

Parameters

string $formulaData

Formula data

string $baseCell

Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas

Returns

array —

readBIFF8CellAddress()

readBIFF8CellAddress(string  $cellAddressStructure) : string

Reads a cell address in BIFF8 e.g. 'A2' or '$A$2' section 3.3.4.

Parameters

string $cellAddressStructure

Returns

string —

readBIFF8CellAddressB()

readBIFF8CellAddressB(string  $cellAddressStructure, string  $baseCell = 'A1') : string

Reads a cell address in BIFF8 for shared formulas. Uses positive and negative values for row and column to indicate offsets from a base cell section 3.3.4.

Parameters

string $cellAddressStructure
string $baseCell

Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas

Returns

string —

readBIFF5CellRangeAddressFixed()

readBIFF5CellRangeAddressFixed(string  $subData) : string

Reads a cell range address in BIFF5 e.g. 'A2:B6' or 'A1' always fixed range section 2.5.14.

Parameters

string $subData

Returns

string —

readBIFF8CellRangeAddressFixed()

readBIFF8CellRangeAddressFixed(string  $subData) : string

Reads a cell range address in BIFF8 e.g. 'A2:B6' or 'A1' always fixed range section 2.5.14.

Parameters

string $subData

Returns

string —

readBIFF8CellRangeAddress()

readBIFF8CellRangeAddress(string  $subData) : string

Reads a cell range address in BIFF8 e.g. 'A2:B6' or '$A$2:$B$6' there are flags indicating whether column/row index is relative section 3.3.4.

Parameters

string $subData

Returns

string —

readBIFF8CellRangeAddressB()

readBIFF8CellRangeAddressB(string  $subData, string  $baseCell = 'A1') : string

Reads a cell range address in BIFF8 for shared formulas. Uses positive and negative values for row and column to indicate offsets from a base cell section 3.3.4.

Parameters

string $subData
string $baseCell

Base cell

Returns

string —

Cell range address

readBIFF8CellRangeAddressList()

readBIFF8CellRangeAddressList(string  $subData) : array

Read BIFF8 cell range address list section 2.5.15.

Parameters

string $subData

Returns

array —

readBIFF5CellRangeAddressList()

readBIFF5CellRangeAddressList(string  $subData) : array

Read BIFF5 cell range address list section 2.5.15.

Parameters

string $subData

Returns

array —

readSheetRangeByRefIndex()

readSheetRangeByRefIndex(int  $index) : false|string

Get a sheet range like Sheet1:Sheet3 from REF index Note: If there is only one sheet in the range, one gets e.g Sheet1 It can also happen that the REF structure uses the -1 (FFFF) code to indicate deleted sheets, in which case an Exception is thrown.

Parameters

int $index

Returns

false|string —

readBIFF8ConstantArray()

readBIFF8ConstantArray(string  $arrayData) : array

read BIFF8 constant value array from array data returns e.g. ['value' => '{1,2;3,4}', 'size' => 40] section 2.5.8.

Parameters

string $arrayData

Returns

array —

readBIFF8Constant()

readBIFF8Constant(string  $valueData) : array

read BIFF8 constant value which may be 'Empty Value', 'Number', 'String Value', 'Boolean Value', 'Error Value' section 2.5.7 returns e.g. ['value' => '5', 'size' => 9].

Parameters

string $valueData

Returns

array —

readRGB()

readRGB(string  $rgb) : array

Extract RGB color OpenOffice.org's Documentation of the Microsoft Excel File Format, section 2.5.4.

Parameters

string $rgb

Encoded RGB value (4 bytes)

Returns

array —

readByteStringShort()

readByteStringShort(string  $subData) : array

Read byte string (8-bit string length) OpenOffice documentation: 2.5.2.

Parameters

string $subData

Returns

array —

readByteStringLong()

readByteStringLong(string  $subData) : array

Read byte string (16-bit string length) OpenOffice documentation: 2.5.2.

Parameters

string $subData

Returns

array —

readUnicodeStringShort()

readUnicodeStringShort(string  $subData) : array

Extracts an Excel Unicode short string (8-bit string length) OpenOffice documentation: 2.5.3 function will automatically find out where the Unicode string ends.

Parameters

string $subData

Returns

array —

readUnicodeStringLong()

readUnicodeStringLong(string  $subData) : array

Extracts an Excel Unicode long string (16-bit string length) OpenOffice documentation: 2.5.3 this function is under construction, needs to support rich text, and Asian phonetic settings.

Parameters

string $subData

Returns

array —

readUnicodeString()

readUnicodeString(string  $subData, int  $characterCount) : array

Read Unicode string with no string length field, but with known character count this function is under construction, needs to support rich text, and Asian phonetic settings OpenOffice.org's Documentation of the Microsoft Excel File Format, section 2.5.3.

Parameters

string $subData
int $characterCount

Returns

array —

UTF8toExcelDoubleQuoted()

UTF8toExcelDoubleQuoted(string  $value) : string

Convert UTF-8 string to string surounded by double quotes. Used for explicit string tokens in formulas.

Example: hello"world --> "hello""world".

Parameters

string $value

UTF-8 encoded string

Returns

string —

extractNumber()

extractNumber(string  $data) : float

Reads first 8 bytes of a string and return IEEE 754 float.

Parameters

string $data

Binary string that is at least 8 bytes long

Returns

float —

getIEEE754()

getIEEE754(int  $rknum) : float

Parameters

int $rknum

Returns

float —

encodeUTF16()

encodeUTF16(string  $string, bool  $compressed = false) : string

Get UTF-8 string from (compressed or uncompressed) UTF-16 string.

Parameters

string $string
bool $compressed

Returns

string —

uncompressByteString()

uncompressByteString(string  $string) : string

Convert UTF-16 string in compressed notation to uncompressed form. Only used for BIFF8.

Parameters

string $string

Returns

string —

decodeCodepage()

decodeCodepage(string  $string) : string

Convert string to UTF-8. Only used for BIFF5.

Parameters

string $string

Returns

string —

parseRichText()

parseRichText(mixed  $is) : mixed

Parameters

mixed $is

Returns

mixed —