Escaping for CSV

前端 未结 4 1681
说谎
说谎 2020-12-08 10:38

I need to store a string in a MySQL database. The values will later be used in a CSV. How do I escape the string so that it is CSV-safe? I assume I need to escape the follow

4条回答
  •  [愿得一人]
    2020-12-08 11:08

    Don't store the data CSV escaped in the database. Escape it when you export to CSV using fputcsv. If you're storing it CSV escaped you're essentially storing garbage for all purposes other than CSV exporting.

提交回复
热议问题