Excel is used to store large amount of information in the form of a spreadsheet. Which is easy to manage accounts information and other information. In todays time we save large amount of information online in database but some time we need to convert that data into excel spreadsheet and provide to user. In this post i will explain you how to create excel file online using PHP_XLSXWriter library available on github. You download this from this link : https://github.com/mk-j/PHP_XLSXWriter



PHP_XLSXWriter use less memory to create excel file.

Create simple excel file

To create a simple excel file we need to add this library into our file and need to call some function and we done.

If you want to add data into multiple sheet you simple need to recall writeSheet and add new variable and add them into function as shown below.

All these excel file are save in your server directory. If you want to make it download you need to add some header function in your file

Posted in: php