<?phplist=array(array('aaa','bbb','ccc','dddd'),array('123','456','789'),array('"aaa"','"bbb"'));fp =fopen("/PhpProject/sample.csv","w");foreach(list asfields){fputcsv(fp,fields);}echo"The list data has been inserted successfully to .csv file";fclose($fp);?>
PHP
输出
The list data has been inserted successfully to .csv file