Write CSV To File Without Enclosures In PHP

前端 未结 14 810
谎友^
谎友^ 2020-12-01 07:11

Is there a native function or solid class/library for writing an array as a line in a CSV file without enclosures? fputcsv will default to \" if no

14条回答
  •  萌比男神i
    2020-12-01 07:40

    I use tricky way to remove double quote, but only in Linux

    ....
    fputcsv($fp, $product_data,"\t");
    ....
    shell_exec('sed -i \'s/"//g\' /path/to/your-file.txt ');
    

提交回复
热议问题