simple one
more complex one:
https://gist.github.com/854168
<?php
$content = array('132','654');
$file = 'combine.txt';
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
//header('Content-Length: ' . filesize($file));
ob_clean();
flush();
foreach($content as $item){
echo $item;
}
//readfile($file);
exit;
more complex one:
https://gist.github.com/854168
本文将介绍PHP中文件操作的基础知识,并通过简单与复杂的代码示例演示如何使用PHP进行文件读写与传输。
584

被折叠的 条评论
为什么被折叠?



