Re: \n \t don't work!!!

From: Date: Mon, 13 Oct 2003 12:58:39 +0000
Subject: Re: \n \t don't work!!!
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-165971@lists.php.net to get a copy of this message
On Mon, Oct 13, 2003 at 09:48:56PM +1000, Wang Feng wrote: : : Ok, Now I see what happen (maybe). : : So, the "\n" is not for the browser output, but for the *view source*? So, : it's different from the "echo <br>"? : : If so, what's the deal to do that? --- Makes it look nice if the user view : the source code? When normally rendering HTML text, multiple continuous whitespace characters (i.e. "\s+") as a single space. So HTML source code: ---------------------------------------- <p>How are you? I am fine. What else is new? </p> ---------------------------------------- gets displayed as this: ---------------------------------------- How ar you. I am fine. What else is new? ---------------------------------------- To force a visual linebreak in rendered HTML pages, as you already discovered you need to manually insert "<br>" tags. However, if you don't want to litter your HTML source code with a bunch of gratuitous "<br>" tags all over the place, use the "<pre>" container tag to make the browser render newlines as visual linebreaks.

« previous php.general (#165971) next »