对不起,如果标题不解释太多。让我试着进一步解释。制作多个文件强制下载
我的代码看起来像这样:
<?
//Grab the number in count.txt
$count = intval(file_get_contents('count.txt'));
//Move the number up one
file_put_contents('count.txt', ++$count);
$number = file_get_contents('count.txt');
//Force Download
header('Content-Disposition: attachment; filename=DataFiles'.$number.".csv");
header('Content-Type: application/octet-stream');
//The data
foreach($array as $info){
echo $info."\n";
}
?>
随着$阵列作为数据的数组。
现在有时数据量可能超过5000个,所以如果数据超过5000个,为每5000个正在回显的数据创建另一个文件。 Ea:如果$数组中有20,000条数据,则它将总共创建4个文件。
可能重复http://stackoverflow.com/questions/3663127/php-multiple-file-download) – loganfsmyth 2013-05-06 00:47:55
zip文件...没有别的办法 – 2013-05-06 00:48:57