Download the PHP package parkejunior/spreadsheetmr without Composer
On this page you can find all versions of the php package parkejunior/spreadsheetmr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download parkejunior/spreadsheetmr
More information about parkejunior/spreadsheetmr
Files in parkejunior/spreadsheetmr
Package spreadsheetmr
Short Description Multiformat spreadsheet reader
License MIT
Informations about the package spreadsheetmr
SpreadSheetMR
SpreadSheetMR is a simple multiformat spreadsheet reader.
- Read XLSX, XLS, CSV or TXT files
- Combine header with data
- Ignore row or columns
This library uses shuchkin/SimpleXLS
and shuchkin/SimpleXLSX
for read Excel files.
Installation
First, you will need to install Composer. Then, run the following command:
Usage
Basic
Here is a basic example of using the library:
The getObject
method get data formatted using stdClass
.
Note that the file extension is passed as a separate property from the file path, because the path can be temporary like the superglobal $_FILES['file']['tmp_name']
.
Verify header and limits
You can use the verifyFile()
method by passing an array with some settings. Example:
Ignore row and columns
It is also possible to ignore columns or rows using the ignoreRow()
and ignoreColumn()
methods by passing the index offset as a parameter. Example:
Define which row is the header
You can define which line is the header by passing to the headerIndex
property the index offset of the line. Note that when the header is defined, the getObject ()
method returns a stdClass
combining the header as an association to the data of each line. Example:
Contribution
If you find any incorrect English grammar or any suggestions on how to improve the library, I appreciate it.