Showing posts with label Reading the Excel file. Show all posts
Showing posts with label Reading the Excel file. Show all posts

Friday, January 17, 2020

Parsing Excel File Using SimpleXLSX Part - 2



Parsing Excel File Using SimpleXLSX 

        In last post I have explained briefly about what is the good library for parsing Excel file in PHP. In this post I'm going to explain the next part of that, i.e how to parse the excel and how to read cells.

You need to follow some steps:
  • Download the SimpleXLSX library from github → Clicke Here to download 
  • Extract the zip and copy the folder into your project folder.
  • Create new php file to read the excel
  • include SimpleXLSX library into file using include or require ↓
  • Initialize the Excel File Handler Parse ↓

  • Now try with a simple example

Books.xlsx


example1.php
Output
   

Reading rows 

read_rows.php
Output




Tuesday, January 14, 2020

Parsing Excel File Using SimpleXLSX Part - 1


Parsing Microsoft Excel Files in PHP Easily

When developing a website, you sometimes have to manipulate data in Microsoft Excel format. For example, your website could offer users the option of importing an Excel file that you would parse to integrate its data it into your database, for example. This seemingly trivial task can be complicated. Fortunately, I will present you with a simple and powerful open source solution that will allow you to easily read Excel XLS and XLSX files in PHP.

Powerful And Simple Solution With SimpleXLSX

In this tutorial, I suggest you to parse your files in Microsoft Excel format using the open source solution SimpleXLSX. Solution is a very big word here since SimpleXLSX is a single PHP class without any dependency. To use it, you only have to import it into your PHP scripts.
SimpleXLSX does not need external dependencies because the class does the unzipping and parsing work internally for the Open XML format on which the XLSX files are based.
SimpleXLSX is under MIT license and can be downloaded freely from GitHub: https://github.com/shuchkin/simplexlsx
For parsing XLS files, the PHP code will be the same but you will have to use the SimpleXLS dedicated class provided by the developer of SimpleXLSX.
Parsing and Reading the Excel file will be explained in next post►

Follow me for more Technical Info
Thank You..