Re: re:linebreak
| From: | Jens Nedal | Date: | Wed, 14 Feb 2001 12:36:34 +0000 |
| Subject: | Re: re:linebreak | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-39613@lists.php.net to get a copy of this message | ||
Hy there everyone on the board 8), just a new listviewer droppign in.
In case of displaying \n that are stored in a variable or com from a DB or
inptu field you can also use nl2br($var) which automatically converts those
linebreaks to <br> and so get displayed correctly. Though that will not work
for the tabs.
Jens
----------------------------------------------------------------------------
Ostry & Partner http://www.ostry.com
Hietzingerhauptstr. 145 1130 Vienna, Austria +43 1 877 74 54-18
on 14.02.2001 6:41 Uhr, Steve Werby at steve@247computing.com wrote:
> "Deependra B. Tandukar" <deepndra@icimod.org.np> wrote:
>> I did with <br>. "\r\n" too is not giving a new line.
>
> Actually "\n" does create a newline. If you view the source code of the web
> page from the browser you'll see that it works. "\n" is not an HTML tag.
> It's not designed to create a newline in the HTML output sent to the
> browser. As you discovered, the <BR> tag will do that. Hope that is clear.
> "\n" is typically used in PHP code so that when one looks at the HTML code
> sent to the browser one doesn't have to look at lines of HTML code that
> contain hundreds upon hundreds of characters.
>
> --
> Steve Werby
> COO
> 24-7 Computer Services, LLC
> Tel: 804.817.2470
> http://www.247computing.com/
>