header对文本进行下载思路

<?php 
header("Content-Type: application/force-download"); 
header("Content-Disposition: attachment; filename=".basename($_GET['url'])); 
readfile($filename); 
?> 

类似文章