github:https://github.com/nuovo/spreadsheet-reader
最近有一个读取超大 excel 文件的功能需求, 使用的 phpexcel, 有严重的内存泄露问题, 暂时还未找到解决方案.
spreadsheet-reader 是流式读取 excel 的, 对于大多数格式的 excel 都能正常的读取, 且内存消耗很小.
PS: 其中遇到的坑
xlsx 文件一定要标准, 也就是必须是 offce 生成的, 而不是 wps 之类的...... 被这个坑了很久
如果不正确会出现如下报错, 个人猜测是文件头问题, 建议用 office 打开另存为一份就没问题了
Warning: XMLReader::open(): Empty string supplied as input in C:\myphp_www\PHPTutorial\WWW\spreadsheet-reader-master\SpreadsheetReader_XLSX.php on line 959
Warning: XMLReader::read(): Load Data before trying to read in C:\myphp_www\PHPTutorial\WWW\spreadsheet-reader-master\SpreadsheetReader_XLSX.php on line 995
Notice: Undefined variable: i in C:\myphp_www\PHPTutorial\WWW\test.php on line 10
- Array ( )
- Warning: XMLReader::read(): Load Data before trying to read in C:\myphp_www\PHPTutorial\WWW\spreadsheet-reader-master\SpreadsheetReader_XLSX.php on line 995
来源: http://www.bubuko.com/infodetail-2713446.html