<?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
04-28 15:29