Ok so i’m having a bit of an issue with nl2br() and str_replace.
I have a field in my database which is being echoed out. It is added into the database by the user with a textarea in a form.
When it echos out (if the user has added a line) I get \r\n echoing out too.
I tried using nl2b and str_replace, but it still doesnt work. I used str_replace for other items within the same echo, which works fine, but it refuses to work specifically for the \r\n
Here’s what I have tried so far:
echo str_replace("\r\n", "", $message->message);
and
echo nl2br($message->message);
Neither work. I can’t figure it out!
It looks as CI escaped \r\n too. so if you want your regular linebreaks back try it like this
Now the replace
Or