PHP导出txt格式的文件
$filename = '商品ID_' . $goods['id']; //文件名称 header("Content-type: application/octet-stream"); //定义浏览器输出类型 header("Accept-Ranges: bytes"); header("Content-Disposition: attachment; filename = {$filename}.txt"); //txt文件名称 header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Pragma: public"); echo $content; //输出文件
0 条评论
登陆后才能评论哦~