Forum Moderators: coopster

Message Too Old, No Replies

Hiding new line characters

On windows

         

dbarasuk

12:17 pm on Nov 27, 2009 (gmt 0)

10+ Year Member



Hello all,
If i insert deliberately new line characters (\n\r) in a textarea and send the whole content in a VARCHAR mysql field, there is no problem. But, when I display that field's content on a webpage, i see the new line characters inside my text like \n\r which is of course a programming error. I tried to hide them with htmlentities() function but could not do the job. WHich function can do that for me please?

Tks

henry0

12:24 pm on Nov 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You do not need "typing" it
breaks will be respected if you output your content like:
nl2br($my_string)
nl2br [php.net]