Solve the problem of setting hyperlinks when PHP exports large amounts of data

Source: Internet
Author: User

Today in the export Excel function, because the data to be exported is very large, so do not use phpexcel, but use the way of dynamic generation of file streams to export, encountered a problem, how to set a cell value as a hyperlink it.

The code for setting the cell's value is as follows:

The original idea is to see if you can find a similar code from the Phpexcel reference, find a half-day did not find, and then search engine searches the keyword "Data ss:type", found that the content is "<data ss:type=" String ">" Related, There is nothing I want, I can only find it again.

This is, I found an article:

This is to say that Excel is an XML file, I think, can be in XML format to open the Excel file, to see how the value of the hyperlink format is set.

This article says it can be seen with utraedit, but I can't see the contents of Excel in XML format with Utraedit.

Later I found that I could save the Excel file as an XML file.

Then open with notepad++, you can see the contents of the XML format.

Copy this format, you can set the hyperlink, the code is as follows:

Solve the problem of setting hyperlinks when PHP exports large amounts of data

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.