PHP Excel, which is quite classic and powerful, exports tens of thousands or even hundreds of thousands of records for code sharing.

Source: Internet
Author: User
Tags php excel
Phpexcel, which is quite classic and powerful, exports tens of thousands or even hundreds of thousands of records of code. This question has been asked several times and has not been answered. Therefore, I will study it carefully and refer to relevant materials, finally.

Http://www.youyax.com/forum/index.php/Content-index-id-5058.shtml

The principle is

For example, if the database has 10 thousand records to export, it is estimated that the browser will crash as soon as 10 thousand records are exported.

The idea of this approach is,

1. first query whether the xx.xls file exists. if it does not exist, create the file (first judgment)

2. set the title of the first line (first judgment), read the total number of rows, and then export 500 records.

3. write the xx.xls file,

4. jump to the current page and repeat the previous steps.


Reply to discussion (solution)

A browser crashes? Excel supports a maximum of 65535 lines per tab. isn't phpexcel very weak?

In this simple description, we still don't know about Cainiao.

Er, er ????

Phpexcel provides various caching methods, why not

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.