Search code examples
phpxmlxlsphpoffice

phpoffice can´t read xml inside xls


I need to create a script to read XLS and insert into mysql, so I decide to use phpoffice to do it.

The problem comes when inside this xls is a XML and phpoffice can´t read this row.

For example, if you try to read a xls with this rows:

January

<Febrary>

March

The output only shows you

January

March

Note: there is a blank row between January an March but I´m having problems to show with this wysiwyg.

Can someone tell me how can I Read this XML inside the XLS?

I think the problem is when there is a word between"<" and ">" in a row, but I don´t know how to solve it.

Thank´s


Solution

  • It's not PHPOffice that's causing any problem..... it's your lack of understanding of html markup.

    You're echoing this to a browser..... and a browser treats < as a special character..... use htmlentities() to convert those specia characters to html entities before displaying it in your browser