<?php
function downfile($fileurl)
{
ob_start();
$filename=$fileurl;
// $date=date("Ymd-H:i:m");
$date=date("Ymd");
echo $date;
// header( "Content-type: application/octet-stream ");
header( "Content-type:application/zip");
header( "Accept-Ranges: bytes ");
header( "Content-Disposition: attachment; filename= {$date}.csv");
$size=readfile($filename);
header( "Accept-Length: " .$size);
}
$url="http:XXX.zip";
downfile($url);
?>
不知所谓, 看不明白要表达什么问题
首先, readfile 是输出文件内容到缓存区的, 不知你从哪找的代码, 肯定不能用于你的需求.
下载远程文件, 请百度php file_get_contents()方法, (也可以用curl, 相对稳定但比较复杂,前者够你用了).
至于解压文件, 你需要安装php zip扩展, 并了解相关方法 zip_*(), 提取cvs文件.
CVS只是个数据文件, 你需要把它解析出来一个二维数组的数据, 拼接sql插入到数据库, 这个百度倒是能有不少结果的.
自己了解以上东西, 并自己码代码吧, 网上可没现成的代码给你用, 别人也没太多耐心帮你写, 因为你的需求拆分太多.