Php-excel-Create an Excel file in PHP, how to write data to a different column

Source: Internet
Author: User

Zhuge Fei Qing
Create an Excel file in PHP, how to write data to a different column
Zhuge Fei posted 11-27 16:08 32 minutes ago, 0 back/5 reads (edit | delete)
Discussion Area» Technical questions

Title: I created Excel data

Header ("Content-type:application/vnd.ms-excel");
Header ("Content-disposition:filename=ldata.xls");

and write data to it, into the following:

echo "Test11\t";
echo "test12\t\n";
echo "Test21\t";
echo "test22\t\n";
echo "Test31\t";
echo "test32\t\n";

Originally I wanted to have a form, but the data in it was all in the A1 unit.

How is writing data similar to this form?

Reply content:

Zhuge Fei Qing
Create an Excel file in PHP, how to write data to a different column
Zhuge Fei posted 11-27 16:08 32 minutes ago, 0 back/5 reads (edit | delete)
Discussion Area» Technical questions

Title: I created Excel data

Header ("Content-type:application/vnd.ms-excel");
Header ("Content-disposition:filename=ldata.xls");

and write data to it, into the following:

echo "Test11\t";
echo "test12\t\n";
echo "Test21\t";
echo "test22\t\n";
echo "Test31\t";
echo "test32\t\n";

Originally I wanted to have a form, but the data in it was all in the A1 unit.

How is writing data similar to this form?

                                         

Are you writing your own Excel builder or other third-party tool? Can you explain?
The general PHP scenario for generating Excel is to use a two-dimensional array for line-by-row writes, so that your problem should not arise.
If this answer is not resolved, can you put more detailed source code?

Please use Phpexcel, the official website directly has the example, can let you know very clearly to which cell writes the data. You can even merge cells oh.

Recommended for Phpexcel

CSV can, fputcsv use this function

I use PHP directly here without tools

  • Related Article

    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.