简体   繁体   中英

Convert excel xlsx to xsl in php for php-excel-reader

I have to code a PHP platform for importing an Excel file (quite heavy) to fill an SQL server database. To do so I used the library PHP-excel-reader ( https://code.google.com/archive/p/php-excel-reader/downloads ) to be able recover the value of specific cells (eg $ water = $ data-> val (13, 'A');) everything works fine except that PHP-excel-reader is only compatible with .xls not .xlsx, if I go directly convert my files in excel no problem. But so that the user does not have to do this operation every time I want automated converting .xls .xlsx has. I tried to use PHPExcel ( http://phpexcel.codeplex.com/ ) but nothing works all the file converted by the libraries do not work on PHP-excel-reader. Would you have a solution? If there is no solution do you have knowledge of another library that allows like PHP to store the value of an Excel cell in a variable? I am desperate. Thank you in advance for your help. Sorry for my English I'm french x)

For those interested, I found a solution. It is used the SimpleXLSX library ( http://www.spyrozone.net/hacking/2011/05/php-parse-and-retrieve-data-from-xlsx-files.jsp ), it will return from to an .xlsx an array of values where it will be to recover each cell value. if you have a problem with date conversion check this ( https://www.ablebits.com/office-addins-blog/2015/07/01/excel-convert-time-decimal/ )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM