php输出cvs文件,下载cvs文件
function outputCsv($data, $filename = 'file.csv') {//输出文件,下载文件
header('Content-Type:application/force-download');
header("content-Disposition:filename={$filename}");
foreach ($data as $fields) {
foreach ($fields as $key => $value) {
echo $value . ',';
}
echo "\r\n";
}
}
php输出cvs文件,下载cvs文件
posted on 2014-08-27 11:14 chenzhaojx 阅读(407) 评论(0) 收藏 举报
浙公网安备 33010602011771号