Posted in PHP onDecember 18, 2013
第一段是读文件,下载。
第二段是字符串下载。
<?php $fileName = "prefs.csv"; header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=' . $fileName); header('Content-Transfer-Encoding: binary'); header('Content-Length: ' . filesize($fileName)); readfile($fileName);
<?php $fileName = "pref_" . date("YmdHis") . ".csv"; header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=' . $fileName); echo $csv;
php读取csv实现csv文件下载功能
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@