PhpSpreadsheet is a library written in pure PHP and offers a set of classes thatallow you to read and write various spreadsheet file formats such as Excel and LibreOffice Calc.

  1. In project of PHPOffice there are two projects associated with spreadsheet file formats:. PHPExcel is a library written in pure PHP and providing a set of classes that allow you to write to and read from different spreadsheet file formats, like Excel (BIFF).xls, Excel 2007 (OfficeOpenXML).xlsx, CSV, Libre/OpenOffice Calc.ods, Gnumeric, PDF, HTML.
  2. Create a new PHPExcelStyleAlignment construct Apply styles from array applyFromArray Bind parent. BindParent Get the currently active cell coordinate in currently active sheet. GetActiveCell Get the currently active sheet. GetActiveSheet Get hash code getHashCode Get Horizontal getHorizontal Get indent getIndent.

File formats supported

Open Document Format/OASIS (.ods)
Office Open XML (.xlsx) Excel 2007 and above
BIFF 8 (.xls) Excel 97 and above
BIFF 5 (.xls) Excel 95
SpreadsheetML (.xml) Excel 2003
PDF (using either the TCPDF, Dompdf or mPDF libraries, which need to be installed separately)

PHPExcel is a very powerful library to read and write data into excel. Now this project is archived by author visit to see detail. PHPExcel is officially known as PhpSpreadsheet. I am going to tell you how you can create an excel file with XLSX extension. Download PHPExcel library from here. To export data into excel file you need to follow. To generate an excel file in core php we can use phpexcel library from the following link here - download phpexcel librarylets cut the chase and see how can we do it:first of all extract folder of the library file which we have just downloaded and put it in the setup folder where we need to, create a html form. In case we need to submit the data from the. Reading Excel files with PHP can be tricky, but fortunately there is a great library that makes this task a lot easier: PHPExcel.In the following article I will show you how to use it to convert the excel sheets into PHP arrays and use the data in PHP.

Software requirements

PHP version 7.2 or newer to develop using PhpSpreadsheet. Other requirements, such as PHP extensions, are enforced bycomposer. See the require section of the composer.json filefor details.

Phpexcel Pdf

PHP version support

Support for PHP versions will only be maintained for a period of six months beyond theend of life of that PHP version.

Phpexcel Api


Use composer to install PhpSpreadsheet into your project:

Or also download the documentation and samples if you plan to use them:

Hello World

This would be the simplest way to write a spreadsheet:

Learn by example

A good way to get started is to run some of the samples. Don't forget to download them via --prefer-source composerflag. And then serve them via PHP built-in webserver:

Then point your browser to:


The samples may also be run directly from the command line, for example:

Learn by documentation

For more documentation in depth, you may read about an overview of thearchitecture,creating a spreadsheet,worksheets,accessing cells andreading and writing to files.

Install Phpexcel

Or browse the API documentation.


Please refer to the contributorlistfor up-to-date credits.