Re: [PHP] new lines in textareas?



On Sat, Mar 29, 2008 at 9:26 PM, Mary Anderson
<maryfran@xxxxxxxxxxxxxxxxxx> wrote:
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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



\n, or just a plain line break, should work.

<?php
echo '<textarea>Hello,
My favorite color is blue.
Signed,
Me!';
?>

Should work.

-Casey
.



Relevant Pages

  • Re: Attempt to de-mystify AJAX
    ... created and populated by the PHP script. ... string is initialized in line 1 to the opening select tag. ...
    (comp.databases.pick)
  • Re: File permissions for a wiki-like site
    ... the content using PHP scripts. ... content to be writable by my PHP script. ... The only one doing the writing will be the Apache user itself. ... The web user is used for things like ...
    (comp.lang.php)
  • Re: File permissions for a wiki-like site
    ... the content using PHP scripts. ... content to be writable by my PHP script. ... The only one doing the writing will be the Apache user itself. ... The web user is used for things like ...
    (comp.lang.php)
  • Re: File permissions for a wiki-like site
    ... the content using PHP scripts. ... content to be writable by my PHP script. ... The only one doing the writing will be the Apache user itself. ... The web user is used for things like ...
    (comp.lang.php)
  • Re: High Scores
    ... If you want to view High scores it returns Could Not load scores ... here is the PHP script ... Edit the game Flash file to point to this file on your server ... >> And the PHP script is here ...
    (alt.php)