Welcome Guest, Not a member yet? Register   Sign In
Using escape_str() or escape() produces a backslash \n character rather than \r\n
#1

[eluser]brandobandido[/eluser]
Hi CI Experts,

Badly need your help here. I'm stuck to this issue for a couple of weeks already.

The issue was using the escape_str() or escape() produces a backslash n (\n) in the database record. E.g.
if I type in the text field

Code:
Hi This is it
Code:
Hi This is it

In the database, I will get

Code:
Hi This is it\n Hi This is it

The output in my view in the textarea is this

Code:
Hi This is it\n Hi This is it

If I use stripslashes(), it will remove the slash and the "n" will still remain.

So the output will become like this

Code:
Hi This is it n Hi This is it

What am I doing wrong here? Or is this a bug?


Any help would be greatly appreciated. Thanks!


Messages In This Thread
Using escape_str() or escape() produces a backslash \n character rather than \r\n - by El Forum - 04-05-2011, 08:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB