phpheader ("Content-Type: Application / Vnd.ms-Excel"); Header ("Content-Disposition: FileName = Test.xls"); Echo "TEST1 / T"; ECHO "TEST2 / T / N"; Echo "TEST1 / T"; Echo "TEST2 / T / N"; ECHO "TEST1 / T"; ECHO "TEST2 / T / N"; ECHO "TEST1 / T"; ECHO "TEST2 / T / N"; ECHO " TEST1 / T "; ECHO" TEST2 / T / N "; ECHO" TEST1 / T "; ECHO" TEST2 / T / N ";
?>
Write a variety of formats Php header ("Content-Type: Application / VND.MS-Excel"); Header ("Content-Disposition: FileName = Order.xls"); // You can handle a general PHP The file is processed, can connect to the database, display the image, etc., will last in the Excel file?> In the PHP environment, you can see the browser asking the user to download the Excel document, click save, hard disk There are more Excel files, use Excel to open the final result, how is it good? In fact, when doing real applications, you can take the information from the database, then follow / t according to each column of data, each line of information is completed, and the method of add / N is echo out, at the beginning of PHP ("" Content-type: Application / VND.ms-Excel "); Indicates the excel file, with header (" Content-Disposition: FileName = Test.xls); indicates that the output file name is Text.xls. This is OK.