Help with fwrite command.

Discussion in 'PHP' started by keeganray, Mar 4, 2010.

  1. #1
    Hi,

    I am trying to use a PHP file to write another PHP file. I've got most of my code working, but I can seem to write the characters "/n". Every time I do, the PHP file just skips to the next line. I have tried printing "/" and the "n" with two separate fwrite commands, but this still does not work. How do I get around this problem?

    Thanks,

    Keegan
     
    keeganray, Mar 4, 2010 IP
  2. bitist

    bitist Peon

    Messages:
    28
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Are you referring to newline?
    If yes then try in this way:
    $towrite = $line . "\n";
    PHP:
     
    bitist, Mar 4, 2010 IP
  3. keeganray

    keeganray Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, but I just figured it out. I used "\x5cn" and it printed \n instead of moving to a new line.
     
    keeganray, Mar 4, 2010 IP