XlsBase
extends BaseReader
in package
Table of Contents
Constants
- BORDER_STYLE_MAP = [ \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_NONE, // => 0x00, \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN, // => 0x01, \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUM, // => 0x02, \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHED, // => 0x03, \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOTTED, // => 0x04, \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK, // => 0x05, \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOUBLE, // => 0x06, \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_HAIR, // => 0x07, \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED, // => 0x08, \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOT, // => 0x09, \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT, // => 0x0A, \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT, // => 0x0B, \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT, // => 0x0C, \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT, // => 0x0D, \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_OMIT, // => 0x0E, \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_OMIT, ]
- MS_BIFF_CRYPTO_NONE = 0
- MS_BIFF_CRYPTO_RC4 = 2
- MS_BIFF_CRYPTO_XOR = 1
- REKEY_BLOCK = 0x400
- XLS_BIFF7 = 0x500
- XLS_BIFF8 = 0x600
- XLS_TYPE_ARRAY = 0x221
- XLS_TYPE_BLANK = 0x201
- XLS_TYPE_BOF = 0x809
- XLS_TYPE_BOOLERR = 0x205
- XLS_TYPE_BOTTOMMARGIN = 0x29
- XLS_TYPE_CFHEADER = 0x1b0
- XLS_TYPE_CFRULE = 0x1b1
- XLS_TYPE_CODEPAGE = 0x42
- XLS_TYPE_COLINFO = 0x7d
- XLS_TYPE_CONTINUE = 0x3c
- XLS_TYPE_DATAVALIDATION = 0x1be
- XLS_TYPE_DATAVALIDATIONS = 0x1b2
- XLS_TYPE_DATEMODE = 0x22
- XLS_TYPE_DBCELL = 0xd7
- XLS_TYPE_DEFAULTROWHEIGHT = 0x225
- XLS_TYPE_DEFCOLWIDTH = 0x55
- XLS_TYPE_DEFINEDNAME = 0x18
- XLS_TYPE_DIMENSION = 0x200
- XLS_TYPE_EOF = 0xa
- XLS_TYPE_EXTERNALBOOK = 0x1ae
- XLS_TYPE_EXTERNNAME = 0x23
- XLS_TYPE_EXTERNSHEET = 0x17
- XLS_TYPE_EXTSST = 0xff
- XLS_TYPE_FILEPASS = 0x2f
- XLS_TYPE_FONT = 0x31
- XLS_TYPE_FOOTER = 0x15
- XLS_TYPE_FORMAT = 0x41e
- XLS_TYPE_FORMULA = 0x6
- XLS_TYPE_HCENTER = 0x83
- XLS_TYPE_HEADER = 0x14
- XLS_TYPE_HORIZONTALPAGEBREAKS = 0x1b
- XLS_TYPE_HYPERLINK = 0x1b8
- XLS_TYPE_IMDATA = 0x7f
- XLS_TYPE_INDEX = 0x20b
- XLS_TYPE_LABEL = 0x204
- XLS_TYPE_LABELSST = 0xfd
- XLS_TYPE_LEFTMARGIN = 0x26
- XLS_TYPE_MERGEDCELLS = 0xe5
- XLS_TYPE_MSODRAWING = 0xec
- XLS_TYPE_MSODRAWINGGROUP = 0xeb
- XLS_TYPE_MULBLANK = 0xbe
- XLS_TYPE_MULRK = 0xbd
- XLS_TYPE_NOTE = 0x1c
- XLS_TYPE_NUMBER = 0x203
- XLS_TYPE_OBJ = 0x5d
- XLS_TYPE_OBJECTPROTECT = 0x63
- XLS_TYPE_PAGELAYOUTVIEW = 0x88b
- XLS_TYPE_PAGESETUP = 0xa1
- XLS_TYPE_PALETTE = 0x92
- XLS_TYPE_PANE = 0x41
- XLS_TYPE_PASSWORD = 0x13
- XLS_TYPE_PRINTGRIDLINES = 0x2b
- XLS_TYPE_PROTECT = 0x12
- XLS_TYPE_RANGEPROTECTION = 0x868
- XLS_TYPE_RIGHTMARGIN = 0x27
- XLS_TYPE_RK = 0x27e
- XLS_TYPE_ROW = 0x208
- XLS_TYPE_SCENPROTECT = 0xdd
- XLS_TYPE_SCL = 0xa0
- XLS_TYPE_SELECTION = 0x1d
- XLS_TYPE_SHAREDFMLA = 0x4bc
- XLS_TYPE_SHEET = 0x85
- XLS_TYPE_SHEETLAYOUT = 0x862
- XLS_TYPE_SHEETPR = 0x81
- XLS_TYPE_SHEETPROTECTION = 0x867
- XLS_TYPE_SST = 0xfc
- XLS_TYPE_STRING = 0x207
- XLS_TYPE_STYLE = 0x293
- XLS_TYPE_TOPMARGIN = 0x28
- XLS_TYPE_TXO = 0x1b6
- XLS_TYPE_UNKNOWN = 0xffff
- XLS_TYPE_VCENTER = 0x84
- XLS_TYPE_VERTICALPAGEBREAKS = 0x1a
- XLS_TYPE_WINDOW2 = 0x23e
- XLS_TYPE_XF = 0xe0
- XLS_TYPE_XFEXT = 0x87d
- XLS_WORKBOOKGLOBALS = 0x5
- XLS_WORKSHEET = 0x10
- FC000000 = 0xfc << 24
- FE000000 = 0xfe << 24
- HIGH_ORDER_BIT = 0x80 << 24
Properties
- $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'.
- $fileHandle : resource
- $ignoreRowsWithNoCells : bool
- Ignore rows with no cells? Identifies whether the Reader should ignore rows with no cells.
- $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;.
- $loadSheetsOnly : null|array<string|int, string>
- 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.
- $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.
- $readEmptyCells : bool
- Read empty cells? Identifies whether the Reader should read data values for all cells, or should ignore cells containing null value or empty string.
- $readFilter : IReadFilter
- IReadFilter instance.
- $securityScanner : XmlScanner|null
- $valueBinder : IValueBinder|null
Methods
- __construct() : mixed
- canRead() : bool
- Can the current IReader read the file?
- getCodepage() : string
- getIgnoreRowsWithNoCells() : bool
- getIncludeCharts() : bool
- Read charts in workbook? If this is true, then the Reader will include any charts that exist in the workbook.
- getInt2d() : int
- Read 16-bit signed integer.
- getInt4d() : int
- Read 32-bit signed integer.
- getLoadSheetsOnly() : array<string|int, mixed>|null
- 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.
- 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 or structural information (like merges).
- getReadEmptyCells() : bool
- Read empty cells? If this is true (the default), then the Reader will read data values for all cells, irrespective of value.
- getReadFilter() : IReadFilter
- Read filter.
- getSecurityScanner() : XmlScanner|null
- getSecurityScannerOrThrow() : XmlScanner
- getUInt2d() : int
- Read 16-bit unsigned integer.
- getValueBinder() : IValueBinder|null
- listWorksheetInfo() : array<string|int, mixed>
- Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
- listWorksheetNames() : array<string|int, mixed>
- Returns names of the worksheets from a file, possibly without parsing the whole file to a Spreadsheet object.
- load() : Spreadsheet
- Loads Spreadsheet from file.
- setCodepage() : void
- setIgnoreRowsWithNoCells() : self
- setIncludeCharts() : $this
- Set read charts in workbook Set to true, to advise the Reader to include any charts that exist in the workbook.
- setLoadAllSheets() : $this
- Set all sheets to load Tells the Reader to load all worksheets from the workbook.
- setLoadSheetsOnly() : $this
- Set which sheets to load.
- setReadDataOnly() : $this
- Set read data only Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting or structural information (like merges).
- setReadEmptyCells() : $this
- Set read empty cells Set to true (the default) to advise the Reader read data values for all cells, irrespective of value.
- setReadFilter() : $this
- Set read filter.
- setValueBinder() : self
- decodeCodepage() : string
- Convert string to UTF-8. Only used for BIFF5.
- encodeUTF16() : string
- Get UTF-8 string from (compressed or uncompressed) UTF-16 string.
- extractNumber() : int|float
- Reads first 8 bytes of a string and return IEEE 754 float.
- getIEEE754() : float|int
- loadSpreadsheetFromFile() : Spreadsheet
- openFile() : void
- Open file for reading.
- processFlags() : void
- readRGB() : array<string|int, mixed>
- Extract RGB color OpenOffice.org's Documentation of the Microsoft Excel File Format, section 2.5.4.
- readUnicodeString() : array<string|int, mixed>
- 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.
- readUnicodeStringLong() : array<string|int, mixed>
- 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.
- readUnicodeStringShort() : array<string|int, mixed>
- 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.
- uncompressByteString() : string
- Convert UTF-16 string in compressed notation to uncompressed form. Only used for BIFF8.
- UTF8toExcelDoubleQuoted() : string
- Convert UTF-8 string to string surounded by double quotes. Used for explicit string tokens in formulas.
Constants
BORDER_STYLE_MAP
public
final mixed
BORDER_STYLE_MAP
= [
\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_NONE,
// => 0x00,
\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN,
// => 0x01,
\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUM,
// => 0x02,
\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHED,
// => 0x03,
\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOTTED,
// => 0x04,
\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK,
// => 0x05,
\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOUBLE,
// => 0x06,
\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_HAIR,
// => 0x07,
\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED,
// => 0x08,
\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOT,
// => 0x09,
\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT,
// => 0x0A,
\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT,
// => 0x0B,
\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT,
// => 0x0C,
\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT,
// => 0x0D,
\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_OMIT,
// => 0x0E,
\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_OMIT,
]
MS_BIFF_CRYPTO_NONE
public
final mixed
MS_BIFF_CRYPTO_NONE
= 0
MS_BIFF_CRYPTO_RC4
public
final mixed
MS_BIFF_CRYPTO_RC4
= 2
MS_BIFF_CRYPTO_XOR
public
final mixed
MS_BIFF_CRYPTO_XOR
= 1
REKEY_BLOCK
public
final mixed
REKEY_BLOCK
= 0x400
XLS_BIFF7
public
final mixed
XLS_BIFF7
= 0x500
XLS_BIFF8
public
final mixed
XLS_BIFF8
= 0x600
XLS_TYPE_ARRAY
public
final mixed
XLS_TYPE_ARRAY
= 0x221
XLS_TYPE_BLANK
public
final mixed
XLS_TYPE_BLANK
= 0x201
XLS_TYPE_BOF
public
final mixed
XLS_TYPE_BOF
= 0x809
XLS_TYPE_BOOLERR
public
final mixed
XLS_TYPE_BOOLERR
= 0x205
XLS_TYPE_BOTTOMMARGIN
public
final mixed
XLS_TYPE_BOTTOMMARGIN
= 0x29
XLS_TYPE_CFHEADER
public
final mixed
XLS_TYPE_CFHEADER
= 0x1b0
XLS_TYPE_CFRULE
public
final mixed
XLS_TYPE_CFRULE
= 0x1b1
XLS_TYPE_CODEPAGE
public
final mixed
XLS_TYPE_CODEPAGE
= 0x42
XLS_TYPE_COLINFO
public
final mixed
XLS_TYPE_COLINFO
= 0x7d
XLS_TYPE_CONTINUE
public
final mixed
XLS_TYPE_CONTINUE
= 0x3c
XLS_TYPE_DATAVALIDATION
public
final mixed
XLS_TYPE_DATAVALIDATION
= 0x1be
XLS_TYPE_DATAVALIDATIONS
public
final mixed
XLS_TYPE_DATAVALIDATIONS
= 0x1b2
XLS_TYPE_DATEMODE
public
final mixed
XLS_TYPE_DATEMODE
= 0x22
XLS_TYPE_DBCELL
public
final mixed
XLS_TYPE_DBCELL
= 0xd7
XLS_TYPE_DEFAULTROWHEIGHT
public
final mixed
XLS_TYPE_DEFAULTROWHEIGHT
= 0x225
XLS_TYPE_DEFCOLWIDTH
public
final mixed
XLS_TYPE_DEFCOLWIDTH
= 0x55
XLS_TYPE_DEFINEDNAME
public
final mixed
XLS_TYPE_DEFINEDNAME
= 0x18
XLS_TYPE_DIMENSION
public
final mixed
XLS_TYPE_DIMENSION
= 0x200
XLS_TYPE_EOF
public
final mixed
XLS_TYPE_EOF
= 0xa
XLS_TYPE_EXTERNALBOOK
public
final mixed
XLS_TYPE_EXTERNALBOOK
= 0x1ae
XLS_TYPE_EXTERNNAME
public
final mixed
XLS_TYPE_EXTERNNAME
= 0x23
XLS_TYPE_EXTERNSHEET
public
final mixed
XLS_TYPE_EXTERNSHEET
= 0x17
XLS_TYPE_EXTSST
public
final mixed
XLS_TYPE_EXTSST
= 0xff
XLS_TYPE_FILEPASS
public
final mixed
XLS_TYPE_FILEPASS
= 0x2f
XLS_TYPE_FONT
public
final mixed
XLS_TYPE_FONT
= 0x31
XLS_TYPE_FOOTER
public
final mixed
XLS_TYPE_FOOTER
= 0x15
XLS_TYPE_FORMAT
public
final mixed
XLS_TYPE_FORMAT
= 0x41e
XLS_TYPE_FORMULA
public
final mixed
XLS_TYPE_FORMULA
= 0x6
XLS_TYPE_HCENTER
public
final mixed
XLS_TYPE_HCENTER
= 0x83
XLS_TYPE_HEADER
public
final mixed
XLS_TYPE_HEADER
= 0x14
XLS_TYPE_HORIZONTALPAGEBREAKS
public
final mixed
XLS_TYPE_HORIZONTALPAGEBREAKS
= 0x1b
XLS_TYPE_HYPERLINK
public
final mixed
XLS_TYPE_HYPERLINK
= 0x1b8
XLS_TYPE_IMDATA
public
final mixed
XLS_TYPE_IMDATA
= 0x7f
XLS_TYPE_INDEX
public
final mixed
XLS_TYPE_INDEX
= 0x20b
XLS_TYPE_LABEL
public
final mixed
XLS_TYPE_LABEL
= 0x204
XLS_TYPE_LABELSST
public
final mixed
XLS_TYPE_LABELSST
= 0xfd
XLS_TYPE_LEFTMARGIN
public
final mixed
XLS_TYPE_LEFTMARGIN
= 0x26
XLS_TYPE_MERGEDCELLS
public
final mixed
XLS_TYPE_MERGEDCELLS
= 0xe5
XLS_TYPE_MSODRAWING
public
final mixed
XLS_TYPE_MSODRAWING
= 0xec
XLS_TYPE_MSODRAWINGGROUP
public
final mixed
XLS_TYPE_MSODRAWINGGROUP
= 0xeb
XLS_TYPE_MULBLANK
public
final mixed
XLS_TYPE_MULBLANK
= 0xbe
XLS_TYPE_MULRK
public
final mixed
XLS_TYPE_MULRK
= 0xbd
XLS_TYPE_NOTE
public
final mixed
XLS_TYPE_NOTE
= 0x1c
XLS_TYPE_NUMBER
public
final mixed
XLS_TYPE_NUMBER
= 0x203
XLS_TYPE_OBJ
public
final mixed
XLS_TYPE_OBJ
= 0x5d
XLS_TYPE_OBJECTPROTECT
public
final mixed
XLS_TYPE_OBJECTPROTECT
= 0x63
XLS_TYPE_PAGELAYOUTVIEW
public
final mixed
XLS_TYPE_PAGELAYOUTVIEW
= 0x88b
XLS_TYPE_PAGESETUP
public
final mixed
XLS_TYPE_PAGESETUP
= 0xa1
XLS_TYPE_PALETTE
public
final mixed
XLS_TYPE_PALETTE
= 0x92
XLS_TYPE_PANE
public
final mixed
XLS_TYPE_PANE
= 0x41
XLS_TYPE_PASSWORD
public
final mixed
XLS_TYPE_PASSWORD
= 0x13
XLS_TYPE_PRINTGRIDLINES
public
final mixed
XLS_TYPE_PRINTGRIDLINES
= 0x2b
XLS_TYPE_PROTECT
public
final mixed
XLS_TYPE_PROTECT
= 0x12
XLS_TYPE_RANGEPROTECTION
public
final mixed
XLS_TYPE_RANGEPROTECTION
= 0x868
XLS_TYPE_RIGHTMARGIN
public
final mixed
XLS_TYPE_RIGHTMARGIN
= 0x27
XLS_TYPE_RK
public
final mixed
XLS_TYPE_RK
= 0x27e
XLS_TYPE_ROW
public
final mixed
XLS_TYPE_ROW
= 0x208
XLS_TYPE_SCENPROTECT
public
final mixed
XLS_TYPE_SCENPROTECT
= 0xdd
XLS_TYPE_SCL
public
final mixed
XLS_TYPE_SCL
= 0xa0
XLS_TYPE_SELECTION
public
final mixed
XLS_TYPE_SELECTION
= 0x1d
XLS_TYPE_SHAREDFMLA
public
final mixed
XLS_TYPE_SHAREDFMLA
= 0x4bc
XLS_TYPE_SHEET
public
final mixed
XLS_TYPE_SHEET
= 0x85
XLS_TYPE_SHEETLAYOUT
public
final mixed
XLS_TYPE_SHEETLAYOUT
= 0x862
XLS_TYPE_SHEETPR
public
final mixed
XLS_TYPE_SHEETPR
= 0x81
XLS_TYPE_SHEETPROTECTION
public
final mixed
XLS_TYPE_SHEETPROTECTION
= 0x867
XLS_TYPE_SST
public
final mixed
XLS_TYPE_SST
= 0xfc
XLS_TYPE_STRING
public
final mixed
XLS_TYPE_STRING
= 0x207
XLS_TYPE_STYLE
public
final mixed
XLS_TYPE_STYLE
= 0x293
XLS_TYPE_TOPMARGIN
public
final mixed
XLS_TYPE_TOPMARGIN
= 0x28
XLS_TYPE_TXO
public
final mixed
XLS_TYPE_TXO
= 0x1b6
XLS_TYPE_UNKNOWN
public
final mixed
XLS_TYPE_UNKNOWN
= 0xffff
XLS_TYPE_VCENTER
public
final mixed
XLS_TYPE_VCENTER
= 0x84
XLS_TYPE_VERTICALPAGEBREAKS
public
final mixed
XLS_TYPE_VERTICALPAGEBREAKS
= 0x1a
XLS_TYPE_WINDOW2
public
final mixed
XLS_TYPE_WINDOW2
= 0x23e
XLS_TYPE_XF
public
final mixed
XLS_TYPE_XF
= 0xe0
XLS_TYPE_XFEXT
public
final mixed
XLS_TYPE_XFEXT
= 0x87d
XLS_WORKBOOKGLOBALS
public
final mixed
XLS_WORKBOOKGLOBALS
= 0x5
XLS_WORKSHEET
public
final mixed
XLS_WORKSHEET
= 0x10
FC000000
protected
final mixed
FC000000
= 0xfc << 24
FE000000
protected
final mixed
FE000000
= 0xfe << 24
HIGH_ORDER_BIT
protected
final mixed
HIGH_ORDER_BIT
= 0x80 << 24
Properties
$codepage
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'.
protected
string
$codepage
= ''
$fileHandle
protected
resource
$fileHandle
$ignoreRowsWithNoCells
Ignore rows with no cells? Identifies whether the Reader should ignore rows with no cells.
protected
bool
$ignoreRowsWithNoCells
= false
Currently implemented only for Xlsx.
$includeCharts
Read charts that are defined in the workbook? Identifies whether the Reader should read the definitions for any charts that exist in the workbook;.
protected
bool
$includeCharts
= false
$loadSheetsOnly
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.
protected
null|array<string|int, string>
$loadSheetsOnly
= null
This property is ignored for Csv, Html, and Slk.
$readDataOnly
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.
protected
bool
$readDataOnly
= false
$readEmptyCells
Read empty cells? Identifies whether the Reader should read data values for all cells, or should ignore cells containing null value or empty string.
protected
bool
$readEmptyCells
= true
$readFilter
IReadFilter instance.
protected
IReadFilter
$readFilter
$securityScanner
protected
XmlScanner|null
$securityScanner
= null
$valueBinder
protected
IValueBinder|null
$valueBinder
= null
Methods
__construct()
public
__construct() : mixed
canRead()
Can the current IReader read the file?
public
canRead(string $filename) : bool
Parameters
- $filename : string
Return values
boolgetCodepage()
public
getCodepage() : string
Return values
stringgetIgnoreRowsWithNoCells()
public
getIgnoreRowsWithNoCells() : bool
Return values
boolgetIncludeCharts()
Read charts in workbook? If this is true, then the Reader will include any charts that exist in the workbook.
public
getIncludeCharts() : bool
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.
Return values
boolgetInt2d()
Read 16-bit signed integer.
public
static getInt2d(string $data, int $pos) : int
Parameters
- $data : string
- $pos : int
Return values
intgetInt4d()
Read 32-bit signed integer.
public
static getInt4d(string $data, int $pos) : int
Parameters
- $data : string
- $pos : int
Return values
intgetLoadSheetsOnly()
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.
public
getLoadSheetsOnly() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetReadDataOnly()
Read data only? If this is true, then the Reader will only read data values for cells, it will not read any formatting or structural information (like merges).
public
getReadDataOnly() : bool
If false (the default) it will read data and formatting.
Return values
boolgetReadEmptyCells()
Read empty cells? If this is true (the default), then the Reader will read data values for all cells, irrespective of value.
public
getReadEmptyCells() : bool
If false it will not read data for cells containing a null value or an empty string.
Return values
boolgetReadFilter()
Read filter.
public
getReadFilter() : IReadFilter
Return values
IReadFiltergetSecurityScanner()
public
getSecurityScanner() : XmlScanner|null
Return values
XmlScanner|nullgetSecurityScannerOrThrow()
public
getSecurityScannerOrThrow() : XmlScanner
Return values
XmlScannergetUInt2d()
Read 16-bit unsigned integer.
public
static getUInt2d(string $data, int $pos) : int
Parameters
- $data : string
- $pos : int
Return values
intgetValueBinder()
public
getValueBinder() : IValueBinder|null
Return values
IValueBinder|nulllistWorksheetInfo()
Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
public
listWorksheetInfo(string $filename) : array<string|int, mixed>
Parameters
- $filename : string
Return values
array<string|int, mixed>listWorksheetNames()
Returns names of the worksheets from a file, possibly without parsing the whole file to a Spreadsheet object.
public
listWorksheetNames(string $filename) : array<string|int, mixed>
Readers will often have a more efficient method with which they can override this method.
Parameters
- $filename : string
Return values
array<string|int, mixed>load()
Loads Spreadsheet from file.
public
load(string $filename[, int $flags = 0 ]) : Spreadsheet
Parameters
- $filename : string
-
The name of the file to load
- $flags : int = 0
-
the optional second parameter flags may be used to identify specific elements that should be loaded, but which won't be loaded by default, using these values: IReader::LOAD_WITH_CHARTS - Include any charts that are defined in the loaded file
Return values
SpreadsheetsetCodepage()
public
setCodepage(string $codepage) : void
Parameters
- $codepage : string
setIgnoreRowsWithNoCells()
public
setIgnoreRowsWithNoCells(bool $ignoreRowsWithNoCells) : self
Parameters
- $ignoreRowsWithNoCells : bool
Return values
selfsetIncludeCharts()
Set read charts in workbook Set to true, to advise the Reader to include any charts that exist in the workbook.
public
setIncludeCharts(bool $includeCharts) : $this
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
- $includeCharts : bool
Return values
$thissetLoadAllSheets()
Set all sheets to load Tells the Reader to load all worksheets from the workbook.
public
setLoadAllSheets() : $this
Return values
$thissetLoadSheetsOnly()
Set which sheets to load.
public
setLoadSheetsOnly(string|array<string|int, mixed>|null $sheetList) : $this
Parameters
- $sheetList : string|array<string|int, mixed>|null
Return values
$thissetReadDataOnly()
Set read data only Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting or structural information (like merges).
public
setReadDataOnly(bool $readCellValuesOnly) : $this
Set to false (the default) to advise the Reader to read both data and formatting for cells.
Parameters
- $readCellValuesOnly : bool
Return values
$thissetReadEmptyCells()
Set read empty cells Set to true (the default) to advise the Reader read data values for all cells, irrespective of value.
public
setReadEmptyCells(bool $readEmptyCells) : $this
Set to false to advise the Reader to ignore cells containing a null value or an empty string.
Parameters
- $readEmptyCells : bool
Return values
$thissetReadFilter()
Set read filter.
public
setReadFilter(IReadFilter $readFilter) : $this
Parameters
- $readFilter : IReadFilter
Return values
$thissetValueBinder()
public
setValueBinder(IValueBinder|null $valueBinder) : self
Parameters
- $valueBinder : IValueBinder|null
Return values
selfdecodeCodepage()
Convert string to UTF-8. Only used for BIFF5.
protected
decodeCodepage(string $string) : string
Parameters
- $string : string
Return values
stringencodeUTF16()
Get UTF-8 string from (compressed or uncompressed) UTF-16 string.
protected
static encodeUTF16(string $string[, bool $compressed = false ]) : string
Parameters
- $string : string
- $compressed : bool = false
Return values
stringextractNumber()
Reads first 8 bytes of a string and return IEEE 754 float.
protected
static extractNumber(string $data) : int|float
Parameters
- $data : string
-
Binary string that is at least 8 bytes long
Return values
int|floatgetIEEE754()
protected
static getIEEE754(int $rknum) : float|int
Parameters
- $rknum : int
Return values
float|intloadSpreadsheetFromFile()
protected
loadSpreadsheetFromFile(string $filename) : Spreadsheet
Parameters
- $filename : string
Return values
SpreadsheetopenFile()
Open file for reading.
protected
openFile(string $filename) : void
Parameters
- $filename : string
processFlags()
protected
processFlags(int $flags) : void
Parameters
- $flags : int
readRGB()
Extract RGB color OpenOffice.org's Documentation of the Microsoft Excel File Format, section 2.5.4.
protected
static readRGB(string $rgb) : array<string|int, mixed>
Parameters
- $rgb : string
-
Encoded RGB value (4 bytes)
Return values
array<string|int, mixed>readUnicodeString()
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.
protected
static readUnicodeString(string $subData, int $characterCount) : array<string|int, mixed>
Parameters
- $subData : string
- $characterCount : int
Return values
array<string|int, mixed>readUnicodeStringLong()
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.
protected
static readUnicodeStringLong(string $subData) : array<string|int, mixed>
Parameters
- $subData : string
Return values
array<string|int, mixed>readUnicodeStringShort()
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.
protected
static readUnicodeStringShort(string $subData) : array<string|int, mixed>
Parameters
- $subData : string
Return values
array<string|int, mixed>uncompressByteString()
Convert UTF-16 string in compressed notation to uncompressed form. Only used for BIFF8.
protected
static uncompressByteString(string $string) : string
Parameters
- $string : string
Return values
stringUTF8toExcelDoubleQuoted()
Convert UTF-8 string to string surounded by double quotes. Used for explicit string tokens in formulas.
protected
static UTF8toExcelDoubleQuoted(string $value) : string
Example: hello"world --> "hello""world".
Parameters
- $value : string
-
UTF-8 encoded string