waid 发表于 2017-3-30 11:50:08

PHP做文件下载

  $filename =$filename.".txt";    //要下载的文件名
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=".basename($filename));
readfile($filename);//也可以是echo 一个变量
页: [1]
查看完整版本: PHP做文件下载