Re: newbie question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/5/06, David Doonan <dadoonan@xxxxxxxxxxxx> 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

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux