RE: [PHP] re:linebreak

From: Date: Fri, 16 Feb 2001 03:18:12 +0000
Subject: RE: [PHP] re:linebreak
Groups: php.general 
Request: Send a blank email to php-general+get-40068@lists.php.net to get a copy of this message
for the tabs? use Regular Expressions to do all that kind of jobs if you really need it: $multiplier = 4; $text = ereg_replace("\t", str_replace('&nbsp;', $multiplier), $text) Or simply use our good-old <PRE> tag. Cheers, Maxim Maletsky -----Original Message----- From: Jens Nedal [mailto:jnedal@ostry.com] Sent: Wednesday, February 14, 2001 9:37 PM To: php-general@lists.php.net Subject: Re: [PHP] re:linebreak 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/ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#40068) next »