newline problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dabbler

    newline problem

    I just installed php 4.3 on windows xp. It seems that new lines are ignored.
    The following code
    <?php
    for ($i=0; $i<10; $i++){
    print "test";
    }
    ?>
    outputs the word test ten times on the same line instead of on ten different
    lines.

    Any suggestions would be appreciated.

    Thanks much.


  • dabbler

    #2
    Re: newline problem

    sorry that should have been print "test\n";

    "dabbler" <mla@zitinkoz.c om> wrote in message
    news:j8K9b.40$i T4.18733@news1. news.adelphia.n et...[color=blue]
    > I just installed php 4.3 on windows xp. It seems that new lines are[/color]
    ignored.[color=blue]
    > The following code
    > <?php
    > for ($i=0; $i<10; $i++){
    > print "test";
    > }
    > ?>
    > outputs the word test ten times on the same line instead of on ten[/color]
    different[color=blue]
    > lines.
    >
    > Any suggestions would be appreciated.
    >
    > Thanks much.
    >
    >[/color]


    Comment

    • Geoff Berrow

      #3
      Re: newline problem

      I noticed that Message-ID: <j8K9b.40$iT4.1 8733@news1.news .adelphia.net>
      from dabbler contained the following:
      [color=blue]
      >The following code
      ><?php
      > for ($i=0; $i<10; $i++){
      > print "test";
      > }
      >?>
      >outputs the word test ten times on the same line instead of on ten different
      >lines.[/color]

      As it should. Think about it, it's nothing to do with XP.

      --
      Geoff Berrow
      It's only Usenet, no one dies.
      My opinions, not the committee's, mine.
      Simple RFDs http://www.ckdog.co.uk/rfdmaker/

      Comment

      • Michael Appelmans

        #4
        Re: newline problem

        well, as a programmer (and php newbie) I always expected "\n" to output
        a new line but of course we are generating html so I needed <br />
        instead.

        Thanks all the same.

        Michael




        In article <bqremv48a39lve ue94sbqf8gkipn9 g8ukm@4ax.com>, $bl
        $@ckdog.co.uk says...[color=blue]
        > I noticed that Message-ID: <j8K9b.40$iT4.1 8733@news1.news .adelphia.net>
        > from dabbler contained the following:
        >[color=green]
        > >The following code
        > ><?php
        > > for ($i=0; $i<10; $i++){
        > > print "test";
        > > }
        > >?>
        > >outputs the word test ten times on the same line instead of on ten different
        > >lines.[/color]
        >
        > As it should. Think about it, it's nothing to do with XP.
        >
        >[/color]

        Comment

        Working...