简体   繁体   English

在php-excel-reader中将excel xlsx转换为php中的xsl

[英]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. 我必须编写一个PHP平台来导入Excel文件(非常繁重)以填充SQL服务器数据库。 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. 为此,我使用PHP-excel-reader( https://code.google.com/archive/p/php-excel-reader/downloads )库来恢复特定单元格的值(例如$ water = $ data-> val(13,'A');)一切正常,只是PHP-excel-reader只兼容.xls而不是.xlsx,如果我直接在excel中转​​换我的文件没问题。 But so that the user does not have to do this operation every time I want automated converting .xls .xlsx has. 但是,每次我想要自动转换时,用户都不必执行此操作.xls .xlsx具有.xls .xlsx。 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. 我尝试使用PHPExcel( http://phpexcel.codeplex.com/ )但没有任何工作,所有由库转换的文件都不适用于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? 如果没有解决方案你是否知道另一个库允许像PHP一样在变量中存储Excel单元格的值? I am desperate. 我很绝望。 Thank you in advance for your help. 预先感谢您的帮助。 Sorry for my English I'm french x) 对不起我的英语我是法国人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. 它用于SimpleXLSX库( http://www.spyrozone.net/hacking/2011/05/php-parse-and-retrieve-data-from-xlsx-files.jsp ),它将从.xlsx返回一组值,用于恢复每个单元格值。 if you have a problem with date conversion check this ( https://www.ablebits.com/office-addins-blog/2015/07/01/excel-convert-time-decimal/ ) 如果你有日期转换问题,请查看( https://www.ablebits.com/office-addins-blog/2015/07/01/excel-convert-time-decimal/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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