Write CSV To File Without Enclosures In PHP

前端 未结 14 820
谎友^
谎友^ 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条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-01 07:46

    Using "chr(0)" adds a character to the file. After doing some investigation and checking the ASCII Table, I've ended up using the following

    fputcsv($fp, $aLine, $sDelimiter, chr(127));
    

    No issues with extra characters.

提交回复
热议问题