举个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";
?>

解决方案 »

  1.   

    算了csv的也告诉你吧
    <?
    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";
    ?>
      

  2.   

    a,b,c,d
    e,f,g,hthis is the format of csv files.
      

  3.   

    http://pear.php.net/search.php?q=csv&in=packages&x=0&y=0//这俩个类应该可以满足你的需求.