hak*_*kre 87
$handle = fopen("test.csv", "a");
Run Code Online (Sandbox Code Playgroud)
fputcsv($handle, $line); # $line is an array of string values here
Run Code Online (Sandbox Code Playgroud)
fclose($handle);
Run Code Online (Sandbox Code Playgroud)
我希望这是有帮助的.
els*_*hll 11
您可以为文件使用面向对象的接口类 - SplFileObject http://php.net/manual/en/splfileobject.fputcsv.php(PHP 5> = 5.4.0)
$file = new SplFileObject('file.csv', 'a');
$file->fputcsv(array('aaa', 'bbb', 'ccc', 'dddd'));
$file = null;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
63328 次 |
| 最近记录: |