While exporting for .csv, text data should be checked for any linebreaks / new line characters otherwise it will make a fine mess of your .csv exported file. Apart from checking for usual ‘,’ which will make a new coulmn, you need to check for carriage returns and new line characters and clean the input textual data using following snippet:
$newlines = array("\r\n", "\n", "\r");
$updated = str_replace($newlines,' ',strip_tags( stripslashes($input) ));
Hope that helps.
Cheers!
Great thanks! I was looking for this and it solved my problem.. I thought trim() would do the job, but that work…