Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parsing Excel XML with PHP

INTRODUCTION

I'm using excel downloads as a way of users downloading a score sheet, filling out scores and then re-uploading this score sheet into the system.

Part of this requires the data in the database to be put into a CSV. Then its opened on the client computer.

PROBLEM

The problem I'm having is that the CSV does not allow me to use any kind of formatting. This includes hiding cells, making text bold etc.

So parsing the data in and out of an excel format (xls) document would make more sense... But from what I've heard and read, this would be really difficult because of different excel versions etc etc.

QUESTION

I heard that XML is a good way of parsing data into an excel format. I wondered if anyone had any experience of this using php?

Is there a good script anyone has heard of? Does anyone have any comments on different versions of excel opening ir (or even, things like open office or lotus) What do you think if my best step forward?

Thanks very much for your help! Either reply or email me tom at candid sky dot com

like image 205
Tom Avatar asked Aug 26 '09 13:08

Tom


People also ask

How parse data from Excel to PHP?

Parsing The Excel File In PHP First step is to include the SimpleXLSX class into our parseXLSX. php script. Then, we can parse the file by calling the parse static method of the SimpleXLSX class with the path to our Excel file in parameter. This call returns an object represeing the data parsed from the Excel file.

Can I use PHP in XML?

If you run the XML file as a PHP script, then yes.

What is an XML parser in PHP?

An XML Parser is a program that translates XML an XML document into a DOM tree-structure like document. CDATA is used to ignore special characters when parsing XML documents. PHP uses the simplexml_load_file to read XML documents and return the results as a numeric array. PHP DOMDocument class to create XML files.


1 Answers

Try out PHP Excel (not sure if both links are the same) and PHP Excel Reader.

like image 129
Alix Axel Avatar answered Sep 21 '22 08:09

Alix Axel