请问如何导出csv格式的文件??

zhangwoniu112 2006-08-24 04:26:25
请各位高手帮忙,然后导出csv格式的文件?
...全文
686 6 打赏 收藏 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
lantersen 2006-08-24
  • 打赏
  • 举报
回复
http://pear.php.net/search.php?q=csv&in=packages&x=0&y=0//这俩个类应该可以满足你的需求.
zeroleonhart 2006-08-24
  • 打赏
  • 举报
回复
a,b,c,d
e,f,g,h

this is the format of csv files.
aruhan 2006-08-24
  • 打赏
  • 举报
回复
楼上正解
anshenghao 2006-08-24
  • 打赏
  • 举报
回复
算了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";
?>
anshenghao 2006-08-24
  • 打赏
  • 举报
回复
举个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";
?>

21,889

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧