Hi Everyone,
Merry Christmas!
I need some input. I have a form that users input their comments into a database I store it in a longtext field.
Now I am getting it out and need to convert their records to an excel file and everything works great, except, if they put a return in the field. It stores it in the longtext, and when I read it out and write the csv, it reads as a new line and starts a new record.
Example:
The entered :
Test
1
2
3I want to change it to:
Test 1 2 3 (in my CSV file)
I run all my records thru an HTML strip function to remove as much 'junk' (ie href, and code as possible) but I tried to remove the line feeds as such and it did not work.
function htmldeletechars( $string )
{
$string = str_replace ( '<br>', '', $string );
$string = str_replace ( '<p></p>', '', $string );
$string = str_replace ( '\n\r', '', $string );
return $string;
}
I appreciate the help in advance,
Regards,
Don