php点击下载

PHP代码如下:
===========================================================
$filename = '/path/'.$_GET['file'].'.txt'; //文件路径
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=".basename($filename));
readfile($filename);
===========================================================

原文地址:https://www.cnblogs.com/zjj1990/p/7986955.html