fgetcsv fails to read line ending in mac formatted csv file, any better solution?

后端 未结 2 1738
长发绾君心
长发绾君心 2021-01-31 13:51

I was parsing a csv file using php with fgetcsv function. It parsed all content in a line, later i found, csv contains carraige return as \"\\r\". I saw - it was reported as php

2条回答
  •  孤城傲影
    2021-01-31 14:20

    Setting auto_detect_line_endings is explicitly recommended by the php documentation.

    However, I cannot fathom why you would want to delimit lines with \r in 2010. If possible, convert them to the UNIX-style \n.

提交回复
热议问题