酷符网动态语言 > 正文

php导出excel(很简单的一种实现)

2010-08-02 14:05codeif.com

很简单的一个例子,确实可以用,代码如下

<?php
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:attachment;filename=test_data.xls");

$tx='表头';
echo   $tx."\n\n";
//输出内容如下:
echo   "姓名"."\t";
echo   "年龄"."\t";
echo   "学历"."\t";
echo   "\n";
echo   "张三"."\t";
echo   "25"."\t";
echo   "本科"."\t";
?>

相关文章

新浪微博 | 淘段子 | 我的博客 | 淘宝店铺 | jnan.org | RSS
Copyright © 2009 - 2011 酷符网