\n is the code to write a new line, between "double quotes". Actually it translates to a 0D or 0A code. If there is a 0D or 0A in a text or file (or normal text email) it works as a newline. If you look at the _source_ of your HTML file you will see it too.

<BR> is the HTML code for new line. Browsers understand only <BR> (well and <P> and H1-6> also cause a new line), they are taught to ignore the 0A and 0D.

If you have a piece of text coming in from a textarea or database, it usually will have the \n type code. To show such texts in a HTML page you have to translate the \n to <BR>. Because this is so common, PHP has the function nl2br(). If you pronounce this say: "NewLine To BReak".

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



Reply via email to