Re: \n \t don't work!!!
| From: | Wang Feng | Date: | Mon, 13 Oct 2003 13:03:42 +0000 |
| Subject: | Re: \n \t don't work!!! | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-165975@lists.php.net to get a copy of this message | ||
Thank you all for pointing me to the *right* direction!!!
Now I really understand why and what I can do with the \n in php. :-)
cheers,
feng
----- Original Message -----
From: "Eugene Lee" <list-php-1@fsck.net>
To: <php-general@lists.php.net>
Sent: Monday, October 13, 2003 10:58 PM
Subject: Re: [PHP] \n \t don't work!!!
> 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.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php