- <?PHP
- require_once(dirname(FILE).'/inc/config.inc.php');
- header("Content-type:application/vnd.ms-excel");
- header("Content-Disposition:filename=volunteer.xls");
- echo "ID\t";
- echo "姓名 \ t";
- echo "性别 \ t";
- echo "志愿者服务时长 \ t";
- echo "发布时间 \ t\n";
- $dopage->GetPage("SELECT * FROM z_msg");
- while($row = $dosql->GetArray())
- {
- echo $row['id']."\t";
- echo $row['name']."\t";
- echo $row['sex']."\t";
- echo $row['fw']."\t";
- echo $row['posttime']."\t\n";
- }
- ?>
PHP 生成 Excel 文件
原文: https://blog.51cto.com/14143040/2556527
来源: http://www.bubuko.com/infodetail-3698861.html