fputcsv为多字列

时间:2016-01-19 14:31:27

标签: php csv fputcsv

我有像这样的csv行:

title, short desc, long desc, sku 1233, qty 100, 33.99, http://www.wired.com/wp-content/uploads/images_blogs/wiredscience/2011/06/siau_island_tarsier.jpg,

fputcsv之后变为:

title," short desc"," long desc"," sku 1233"," qty 100"," 33.99"," http://www.wired.com/wp-content/uploads/images_blogs/wiredscience/2011/06/siau_island_tarsier.jpg",

使用fputcsv的代码是:

while ( ($fileop = fgetcsv($handle, 1000, ",")) !== false )
                {
                    fputcsv($result, $fileop); 
                }

什么方法可以摆脱多个单词的双引号?

1 个答案:

答案 0 :(得分:0)

无法与fputcsv一起使用,所以我最终使用了fputs

fputs($result, implode($fileop, ',')."\n");