且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在CSV文件中添加新行

更新时间:2023-11-18 22:07:52

打开要附加的CSV文件( fopen ­ 文档 ):

Open the CSV file for appending (fopen­Docs):

$handle = fopen("test.csv", "a");

然后添加您的行( fputcsv ­ 文档 ):

Then add your line (fputcsv­Docs):

fputcsv($handle, $line); # $line is an array of string values here

然后关闭句柄( fclose ­ ):

Then close the handle (fclose­Docs):

fclose($handle);

我希望这对您有帮助。