Code Comments
Programming Forum and web based access to our favorite programming groups.I posted the question earlier about the variables in the select statement
(still doesn't work) I just noticed something else, \n does not work either.
Ex.
<?php echo("this is line 1\n");
echo("this is line 2\n");
?>
the output however looks like this:
this is line 1 this is line 2
Is this some configuration issue?
I am using Win2K Pro with the XAMPP package v 1.3
php 4.3.4
apache 2.0.48
any help clearing up this mystery would be greatly appreciated so I can get
on learning php.
TIA,
jrg
Post Follow-up to this message
"jg" <jrg@nospam-weirdcat.com> wrote in message
news:%3_7c.413$eh7.262@news01.roc.ny...
> I posted the question earlier about the variables in the select statement
> (still doesn't work) I just noticed something else, \n does not work
either.
> Ex.
> <?php echo("this is line 1\n");
> echo("this is line 2\n");
> ?>
> the output however looks like this:
> this is line 1 this is line 2
>
> Is this some configuration issue?
> I am using Win2K Pro with the XAMPP package v 1.3
> php 4.3.4
> apache 2.0.48
>
> any help clearing up this mystery would be greatly appreciated so I can
get
> on learning php.
>
> TIA,
> jrg
>
>
>
/n (new line) will only work for raw output - like PHP command line.
It will also work if you "view source" in notepad or something.
But, \n means nothing to a browser that is looking for HTML tags. It will
be treated as a blank space (I think)
Use the HTML break <br>
Post Follow-up to this message*** jg wrote/escribió (Tue, 23 Mar 2004 17:01:47 GMT):
> <?php echo("this is line 1\n");
> echo("this is line 2\n");
> ?>
> the output however looks like this:
> this is line 1 this is line 2
>
> Is this some configuration issue?
HTML is defined that way: carriage returns are ignored. If you want to
convert carriage returns into HTML tags you need nl2br().
--
--
-- Álvaro G. Vicario - Burgos, Spain
--
Post Follow-up to this messageThanks Nikola, that's what I've been doing but couldn't figure out why the examples from the manual won't work for me. jrg <Nikola Tesla> wrote in message news:qM6dnckL1LAM7f3dRVn-uw@comcast.com... > > "jg" <jrg@nospam-weirdcat.com> wrote in message > news:%3_7c.413$eh7.262@news01.roc.ny... statement > either. > get > > /n (new line) will only work for raw output - like PHP command line. > It will also work if you "view source" in notepad or something. > > But, \n means nothing to a browser that is looking for HTML tags. It will > be treated as a blank space (I think) > Use the HTML break <br> > > >
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.