\n is not a new line to the browser window although if you look at the
HTML source, a new line will exist.  You want to use <br> here.  Now to
demonstrate, use pre, which values whitespace :

    <pre>
        <?php echo "top\nblah\ntext\n\n\n\nboo"; ?>
    </pre>

At any rate, \n does not return a new line within browser window, this is
common question/issue so don't fret :-).  newlines are treated like
any other whitespace to browser.  This is why we have the function
nl2br :

    http://www.php.net/manual/en/function.nl2br.php

Using newlines allows our html source to be pretty and simpler to debug.
And they are useful in such things as in email messages.


Philip


On Wed, 24 Jan 2001, Roman wrote:

> for example echo "text1 \n";
>                   echo "text2 ";
> and result is text1text2
> 
> 
> -----Original Message-----
> From: Philip Olson [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 24, 2001 8:58 AM
> To: Roman
> Cc: Php-General
> Subject: Re: [PHP] problem with \n
> 
> 
> 
> 
> 
> How are you using it (code snip) and what is it not doing for you?
> 
> Philip
> 
> 
> On Wed, 24 Jan 2001, Roman wrote:
> 
> > I have PHP 4.0.4 version but i have problem with this escape command : \n
> :
> > don't
> > work. what's the problem another escape command work with no problems...
> >
> >
> > Thanx,  roman
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to