title: Reading and writing excel files with PHP
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3930975/alternative-for-php-excel">Alternative for PHP_excel</a><br>
    <a href="https://stackoverflow.com/questions/4792543/phpexcel-reader-help-required">PHPExcel reader — help required</a>  </p>
  </blockquote>
  
  
  
  <p>First post. I have a very specific need for reading and writing very large (5mb+) excel files using PHP/My SQL. I have used PHPExcel and, while it is very elegant, it is way too slow and uses far too much PHP memory for my needs. At the moment I am limited to 32M PHP memory from my host.</p>
  
  <p>My current solution is as follows:</p>
  
  <p><strong>Importing to database</strong></p>
  
  <p>I use php-excel reader (<a href="http://code.google.com/p/php-excel-reader/" rel="nofollow noreferrer">http://code.google.com/p/php-excel-reader/</a>) for .xls files - Can import about 3000 rows before PHP runs out of memory.<br>
  I use spreadsheet reader (<a href="https://github.com/nuovo/spreadsheet-reader" rel="nofollow noreferrer">https://github.com/nuovo/spreadsheet-reader</a>) for .xlsx files and so far I've tried 5000 rows+ without running out of memory. It is very slow which leads me to believe it is opening and closing the excel file and reading chunks of data at a time.<br><br>
  <strong>Exporting</strong></p>
  
  <p>PHP Excel for anything under about 500 rows. Works beautifully but is very slow and can't handle for than a few hundred rows with 32Mb PHP memory (Note: I am using cacheing which has helped but not enough)</p>
  
  <p>Basic tab-delimited text for any more than 500 rows. Very fast, no limit on rows but no formatting and not true excel.</p>
  
  <p>Ideally, I'm looking for an all-in-one solution that can read and write .xls and .xlsx files quickly and without running into memory issues. I don't mind a commercial product and would be happy to pay a few hundred dollars for something that works.</p>
  
  <p>I have spent hours scouring the internet and this site but haven't found anything yet.</p>
  
  <p>Any ideas?</p>
  
  <p>PS: If anyone wants to see how I've implemented the above solutions, I'd be happy to share the code</p>