This is fine for HTML as I can use nl2br() or str_replace() to display the new lines/carriage returns. The problem starts when a user logs in to edit data in a textarea, the formatting is lost and I get rn for every new line/carriage return used. For example, if the text is inserted as:
[QUOTE]
Hi.
How are you today?
How’s life?
When the user goes to edit the text in a <textarea>, it comes out as:
[QUOTE]
Hi.rnrnHow are you today?rnrnHow’s life?
Should I just not use “mysqli_real_escape_string” as I’m going to use prepared statements throughout my script or is there a way to solve this problem? I’ve searched google quite a bit and I haven’t found any solution to the problem. I would have thought it would have been quite a common problem for PHP newbies.