Re: newbie question
| From: | John Wells | Date: | Wed, 05 Apr 2006 15:56:59 +0000 |
| Subject: | Re: newbie question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-233276@lists.php.net to get a copy of this message | ||
On 4/5/06, David Doonan <dadoonan@nycap.rr.com> wrote:
> The only difference is the textarea tag from the form. What am I
> missing?
"nl2br" is short for "newline to <br>". If you pass a string of
content that contains newline characters (these signal the ending of a
line of text) to nl2br(), it will replace those newlines with <br>
tags, so that when outputted to the screen, you will see the line
breaks.
The reason why you "see" the line breaks when contained within the
<textarea /> tags is that browsers "honor" newline characters (and
other whitespace) when wrapped in <textarea />. This is similar to
the <pre /> tags.
HTH,
John W