In a CodeIgniter app, I've a textarea for content entry. I'd like to retain new lines but I'm having the issue that when the data is saved, an extra new line is added with each new line, which then displays in the textarea next time I edit.
How can I get rid of this extra new line, preferably before the data is saved?
mysql_real_escape_string shows the data as follows:
this is the first line\r\n\n
this is the second line\r\n\n
this is the third line
Which displays in the textarea like so:
this is the first line
this is the second line
this is the third line
I just want this:
this is the first line
this is the second line
this is the third line