PHP导出excil表格
php导出excel格式文件(xls),只需给php文件加一个文件头,filename 就是导出的xls文件名,当你点击这个文件的url时,就会提示你下载xls文件了
header("Content-Type: application/vnd.ms-execl");
header("Content-Disposition: attachment; filename=info.xls");
header("Pragma: no-cache");
header("Expires:0");
例子:
header("Content-Type: application/vnd.ms-execl");
header("Content-Disposition: attachment; filename=info.xls");
header("Pragma: no-cache");
header("Expires:0");
require_once(dirname(__FILE__)."/../include/config_base.php");
require_once(dirname(__FILE__)."/../dede/config.php");
require_once(dirname(__FILE__)."/../include/pub_datalist.php");
$dsql = new DedeSql(false);
echo "订阅日期"."\t";
echo "订阅内容"."\t";
使用官方Model Context Protocol PHP SDK将PHP应用程序功能暴露为MCP工具、资源和提示,用于代理工作流。
echo "姓名"."\t";
$dsql->SetQuery("Select * from `TableName` order by `id` desc");
$dsql->Execute();
$i = 1;
while($row = $dsql->GetArray()){
echo $row['uTime']."\t";
echo $row['uCont']."\t";
echo $row['uName']."\t";
$i++;
}?>
2014-04-04
php免费学习视频:立即使用
踏上前端学习之旅,开启通往精通之路!从前端基础到项目实战,循序渐进,一步一个脚印,迈向巅峰!










