标签:
<?php
$list = array
(
"George,John,Thomas,USA",
"James,Adrew,Martin,USA",
);
$file = fopen("contacts.csv","w");
foreach ($list as $line)
{
fputcsv($file,split(‘,‘,$line));
}
fclose($file);
?>
以上代码执行后,CSV 文件会类似这样:
George,John,Thomas,USA James,Adrew,Martin,USA
标签:
原文地址:http://www.cnblogs.com/clphp/p/5825725.html