Recommend this page to a friend! |
Classes of Karl Holz | PHP Convert Excel to JSON | README.md | Download |
|
DownloadExcel2JSON is an Excel XML parser to JSON documentThis class will allow you to use your excel workbook as a backend for your Javascript/jQuery and other web applications. It's really simple to use, you can instantiate the class with the excel file you want to read, the file must be ooxml, normally with an xlsx or xlsm file extention MS Excel 2007 Won't work with excel (xls) docs exported with:- Apache Open office (excel 2003 XML save as clashes) - Numbers - Libre Office (excel 2003 XML save as clashes) I made test.xlsx with Oxygen XML, and edited it with LibreOffice. it is the test excel file provided with this class * To see this class in action, view webpage.php and view it's code. Note: if you get an error with the JSON output, set_excel with a second argument as seen bellow
other wise use
configuration supportThe makeconfig.php will generate an ini file so you can filter out cells and change their label, like A1 to Name and A2 the something like surname. Take a look at the example bellow or at the config.ini for more details.
ExamplesSheets test - print_sheets.php => on by default if worksheet not found or set.Prints out a JSON document of a list of excel workbook sheets
Data test - print_sheet_data.phpPrints out a JSON document of excel worksheet cell data in detail
Cell test - print_sheet_cells.phpPrints out a JSON document of excel worksheet cell and their values
Rows test - print_sheet_rows.phpPrints out a JSON document of excel worksheet cell and values grouped into rows
Data filter test - print_filter_data.phpPrints out a JSON document of excel worksheet cell data in detail, only cells added to cell list will be displayed
Cell filter test - print_filter_cells.phpPrints out a JSON document of excel worksheet cell and their values, only cells added to cell list will be displayed
|