I have a large string containing the contents of a CSV file. Up to now, I didn't care about parsing it, as my program was just streaming it from one source to another.
Your mission, should you to decide to accept it, is to tell me the best way of removing line breaks from the data elements of a string containing multiple CSV data rows, without throwing away the line breaks separating the rows themselves. The data is properly quoted, and the implementation must run on PHP 5.2...
id,data,other
1,"This is data
with a line break I want replacing",1
2,"This is a line with no line break in the data",0
3,No quotes,42
4,"Quoted field with ""quotes inside"" which is tricky",84