标签:isp foreach pre control john cache xpl time exp
1.下面是一个非常简单的例子,你可以复制下来运行就可以了,代码如下:
header(‘Content-Type: application/vnd.ms-excel;charset=gbk‘);
header(‘Content-Disposition: attachment;filename=test_‘ . time() . ‘.csv‘);
header(‘Cache-Control: max-age=0‘);
$list = array
(
"George,John,Thomas,USA",
"James,Adrew,Martin,USA",
);
$file = fopen(‘php://output‘, ‘a‘);
foreach ($list as $line)
{
fputcsv($file,explode(‘,‘,$line));
}
fclose($file);
标签:isp foreach pre control john cache xpl time exp
原文地址:http://www.cnblogs.com/kobigood/p/6937408.html