<?php |
02 |
header( "Content-type:application/vnd.ms-excel" );
|
03 |
header( "Content-Disposition:attachment;filename=Export_test.xls" );
|
04 |
$tab = "\t" ; $br = "\n" ;
|
05 |
$head = "编号" . $tab . "备注" . $br ;
|
06 | //输出内容如下: |
07 |
echo $head . $br ;
|
08 |
echo "test321318312" . $tab ;
|
09 |
echo "string1" ;
|
10 |
echo $br ;
|
11 |
|
12 |
echo "330181199006061234" . $tab ; //直接输出会被Excel识别为数字类型
|
13 |
echo "number" ;
|
14 |
echo $br ;
|
15 |
|
16 |
echo "=\"330181199006061234\"" . $tab ; //原样输出需要处理
|
17 |
echo "string2" ;
|
18 |
echo $br ;
|
19 | ?> |