举个excel的例子:<?
header("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";
?>
header("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";
?>
<?
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.csv");
echo "test1,";
echo "test2,";
echo "test1,";
echo "test2,";
echo "test1,";
echo "test2,";
echo "test1,";
echo "test2,";
echo "test1,";
echo "test2,";
echo "test1,";
echo "test2\t\n";
?>
e,f,g,hthis is the format of csv files.