對不起,如果標題不解釋太多。讓我試着進一步解釋。製作多個文件強制下載
我的代碼看起來像這樣:
<?
//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