Download the PHP package dprmc/excel without Composer
On this page you can find all versions of the php package dprmc/excel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package excel
Short Description A php wrapper around the PhpSpreadsheet library.
License MIT
Informations about the package excel
Excel v2
A php library that is a wrapper around the PhpSpreadsheet library.
composer require dprmc/excel
Usage: Create a Simple Spreadsheet
Below is an example showing usage of this class.
You can see we create a couple of associative arrays:
- $rows
- $totals
This library will take the keys from the $rows array, and make those the column headers.
If the output file already exists, this method will append a timestamp at the end to try to make a unique filename.
Usage: Create an Advanced Spreadsheet
Below is an example showing usage of this class.
You can see we create multiple associative arrays:
- $rows
- $totals
- $options
- $columnDataTypes
- $columnsWithCustomNumberFormats
- $columnsWithCustomWidths
- $styles
The '$columnDataTypes' optional associative array parameter will apply the value of the array as the Data Type to the column cells corresponding to the array key.
The '$columnsWithCustomNumberFormats' optional associative array parameter will apply the number format value of the array to the column cells corresponding to the array key.
The '$columnsWithCustomWidths' optional associative array parameter will apply the width value of the array to the column cells corresponding to the array key.
The '$styles' optional associative array parameter will apply the style values of the $styles array to the corresponding column headers, non-header cells, or to a specific cell.
Additionally, an optional boolean parameter '$freezeHeader' will determine if the header row will be frozen. Defaults to 'TRUE'.
If the output file already exists, this method will append a timestamp at the end to try to make a unique filename.
Usage: Create a Workbook with multiple sheets
A multidimensional associative array is used to create a workbook with multiple sheets. Each key of the multidimensional array will represent a new sheet within the Workbook. Each value of the multidimensional array follows the formatting of the advanced sheet shown in the example above.
Usage: Reading a Spreadsheet into a PHP Array
Pass in the path to an XLSX spreadsheet and a sheet name, and this method will return an associative array.