fwrite includes wrong character...

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

    fwrite includes wrong character...

    Hi all!

    I use a simple line as this
    fwrite($fil, $filename. "\n");

    and when I look at the file I get the filename and an odd character in
    the end, but the lineshift does work - AFAIK it should work.... any
    ideas why?

    I write a number of filenames to a file... that is all.

    Sonnich

  • Dave Kelly

    #2
    Re: fwrite includes wrong character...

    Sonnich wrote:[color=blue]
    > Hi all!
    >
    > I use a simple line as this
    > fwrite($fil, $filename. "\n");
    >
    > and when I look at the file I get the filename and an odd character in
    > the end, but the lineshift does work - AFAIK it should work.... any
    > ideas why?
    >
    > I write a number of filenames to a file... that is all.
    >
    > Sonnich
    >[/color]

    You sure its not this? fwrite($fil, $filename. "\n")
    ^

    Comment

    • NC

      #3
      Re: fwrite includes wrong character...

      Sonnich wrote:[color=blue]
      >
      > I use a simple line as this
      > fwrite($fil, $filename. "\n");
      >
      > and when I look at the file I get the filename and an odd character in
      > the end, but the lineshift does work - AFAIK it should work.... any
      > ideas why?[/color]

      Let me guess: you are viewing your file in Notepad on Windows. If
      that's the case, try this:

      fwrite($fil, $filename. "\r\n");

      Cheers,
      NC

      Comment

      • Sonnich

        #4
        Re: fwrite includes wrong character...


        Dave Kelly wrote:[color=blue]
        > Sonnich wrote:[color=green]
        > > I use a simple line as this
        > > fwrite($fil, $filename. "\n");
        > > and when I look at the file I get the filename and an odd character in
        > > the end, but the lineshift does work - AFAIK it should work.... any
        > > ideas why?
        > > I write a number of filenames to a file... that is all.[/color]
        >
        > You sure its not this? fwrite($fil, $filename. "\n")
        > ^[/color]

        I dont undetstand.... the ^ points to L or " ?

        anyway, the fwrite($fil, $filename. "\r\n"); works (NC)

        Thanks

        Comment

        Working...