I'd like some help on this - i have a textarea field, where the user can enter text. The line breaks (\n\r) has to act as real line breaks. So, i've successfully replaced the breaks with the <br /> tag, however, here's the problem - when the user edits these fields again, they appear as <br /> tags in the text field also. How do i nicely replace those tags back in the textarea line break style? Replacing <br /> with \n or \r didn't work.


You have power over edit code right? Do just the opposite, before populating the Textarea, just replace breaks with line breaks

Member Avatar


Use nl2br to show im html. Don't use it to show in textarea. Simple.