用PHP阅读大型excel文件 [英] Reading large excel file with PHP

查看:139
本文介绍了用PHP阅读大型excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用PHPExcel1.7.3c读取一个17MB的excel文件(2003),但是在加载文件之后,它已经超过了120秒的限制。
是否有另一个可以更有效的图书馆?我不需要在造型,我只需要它来支持UTF8。
感谢您的帮助

I'm trying to read a 17MB excel file (2003) with PHPExcel1.7.3c, but it crushes already while loading the file, after exceeding the 120 seconds limit I have. Is there another library that can do it more efficiently? I have no need in styling, I only need it to support UTF8. Thanks for your help

推荐答案

使用PHPExcel时,文件大小不是一个很好的措施,更重要的是获得一些每个工作表中单元格数量(rowsxcolumns)的想法。

Filesize isn't a good measure when using PHPExcel, it's more important to get some idea of the number of cells (rowsxcolumns) in each worksheet.

如果您不需要样式,请拨打:

If you have no need for styling, are you calling:

$objReader->setReadDataOnly(true);

加载文件?

如果您不需要访问所有工作表,或仅在工作表中的某些单元格,请使用

If you don't need to access all worksheets, or only certain cells within a worksheet, look at using

$objReader->setLoadSheetsOnly(array(1,2))

$objReader->setLoadSheetsOnly(1)

或定义一个readFilter

or defining a readFilter

您是否使用单元格缓存?如果是这样,什么方法?这会减慢加载时间。

Are you using cell caching? If so, what method? That slows down the load time.

这篇关于用PHP阅读大型excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆