fputcsv and newline codes

前端 未结 8 2257
别那么骄傲
别那么骄傲 2020-11-28 10:12

I\'m using fputcsv in PHP to output a comma-delimited file of a database query. When opening the file in gedit in Ubuntu, it looks correct - each record has a line break (no

8条回答
  •  感情败类
    2020-11-28 10:52

    alternatively, you can output in native unix format (\n only) then run unix2dos on the resulting file to convert to \r\n in the appropriate places. Just be careful that your data contains no \n's . Also, I see you are using a default separator of ~ . try a default separator of \t .

提交回复
热议问题