If I am writing data to a file in a CSV format, how would I deal with characters such as newlines or quotes? Should I just addslashes() to each value, or should I do something else? Thanks in advance, Kaitlyn
You should write them in the format item1,item2,item3\n\r PHP: from what I can remember. It's been a while since I wrote a script to output a CSV file so maybe I'm getting it wrong.
I think I've determined the issue... New lines can in fact be in the CSV file... but the field shuold be quoted. And any quotes in a field should be double quoted (" turns into ""). Is anyone aware of any other "rules"?