new lines in textareas?



Hi all,
I have a php script which produces text which is to be displayed in a textarea. I have the wrap for the text area set to 'hard'. I need to have newlines inserted in the text.
"\n" and "<br>" don't work. They just get quoted literally in the text. I suspect I need to use htmlspecialchars , but don't know what special character to feed it.

Apologies if this should go to an HTML forum. I checked several archives and did not find anything useful. (They tended to tell me to put in \n or <br>!)

Thanks

Mary Anderson
.



Relevant Pages

  • Re: [PHP] new lines in textareas?
    ... I have a php script which produces text which is to be displayed ... in a textarea. ... I have the wrap for the text area set to 'hard'. ...
    (php.general)
  • Re: [PHP] new lines in textareas?
    ... a textarea. ... I have the wrap for the text area set to 'hard'. ... I suspect I need to use htmlspecialchars, ...
    (php.general)
  • Re: [PHP] new lines in textareas?
    ... $textdata = 'This is a test\nThis is the second line'; ... the text after submitting through the textarea, ... I have a php script which produces text which is to be displayed in ... I have the wrap for the text area set to 'hard'. ...
    (php.general)
  • Re: textarea wrap
    ... I have googled but not found a solution to wordwrap in a textarea using ... is there a style sheet solution or am i stuck with not being able to force ... But overall it is more standard and reliable to set "wrap" attribute: ... "off" has better cross-browser support, ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: Additional help needed with preserving textarea CR/LF
    ... and sets the wrap value to hard, which I thought would preserve CR/LF ... in the textarea: ... What wrap attribute does is handling the lines wrapping inside the ...
    (comp.lang.javascript)