php将内容保存到txt文件中,并自动弹出下载文件窗口的方法:

php导出内容到txt并自动弹出下载文件

$id=array('我爱学习网http://www.5ixuexiwang.com','汇享在线工具箱http://tool.huixiang360.com');
header("Content-type:application/octet-stream");
header("Accept-Ranges:bytes");
header("Content-Disposition:attachment;filename=".'id列表_'.date("YmdHis").".txt");
header("Expires: 0");
header("Cache-Control:must-revalidate,post-check=0,pre-check=0");
header("Pragma:public");
echo implode(",",$id);

 

相关文章:

  • 2022-02-09
  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
猜你喜欢
  • 2021-08-30
  • 2022-12-23
  • 2021-11-23
  • 2021-07-18
  • 2022-12-23
  • 2022-01-11
相关资源
相似解决方案