Reading and writing excel files using PHP

Possible duplicate:
Alternative for PHP_excel
PHPExcel reader - help needed

First message. I have a very specific need to read and write very large (5mb +) excel files using PHP / My SQL. I used PHPExcel and although it is very elegant, it is too slow and uses too much PHP memory for my needs. At the moment I am limited to 32M PHP memory from my host.

My current solution is as follows:

Import to database

I am using php-excel reader ( http://code.google.com/p/php-excel-reader/ ) for .xls files. It can import about 3,000 lines before PHP runs out of memory.
I am using a spreadsheet reader ( https://github.com/nuovo/spreadsheet-reader ) for .xlsx files, and so far I have tried 5000 lines + without running out of memory. It is very slow, which makes me think that it is opening and closing the excel file and reading pieces of data at a time. Export

PHP Excel for only about 500 rows. It works beautifully, but is very slow and cannot process several hundred lines with 32 MB of PHP memory (Note: I use caching, which helped, but not enough)

Tab delimited body text for more than 500 lines. Very fast, with no line restrictions, but not formatting, not true.

Ideally, I'm looking for an all-in-one solution that can quickly and quickly read and write .xls and .xlsx files and not run into memory problems. I am not opposed to a commercial product and will be happy to pay several hundred dollars for what works.

I spent hours cleaning the internet and this site, but found nothing.

Any ideas?

PS: If someone wants to see how I implemented the above solutions, I would be happy to share the code with him

+4
source share
5 answers

Since you are unsatisfied with the speed and memory requirements of PHPExcel, I will tell you about my standard answer to this question. If the answer is not there, then probably it doesn’t exist: this list is as comprehensive as I know .... although people writing their own alternatives to PHPExcel rarely worry that it's hard for me to support -date

+4
source

As far as I know, the excel implementation in php does not have good performance (it took a perl implementation of 8 minutes to write php applications within 3 hours), so I end up using Perl.

The only thing that could cause a problem with running out of memory is to set a higher memory_limit .

+2
source
0
source

I would recommend PHPExcel . Easy to operate and easy to change functionality if required. I used it a lot and never had any problems even with large complex spreadsheets.

-1
source

PHPExcel Class This class can:

  • read
  • records
-2
source

Source: https://habr.com/ru/post/1439782/


All Articles