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