Results 1 to 3 of 3

Thread: newlines? wtf?

  1. #1
    Join Date
    Jul 2002
    Location
    Burnaby
    Posts
    5

    Unanswered: newlines? wtf?

    Okay.. call me a retard or whatever but i'm having a problem getting newline escape characters to work right... this is what i did:

    echo "test \n test2";

    and the output was:

    test test2


    ---

    why the heck does a\n not work the way it's supposed to? Is this something that needs to be enabled in the .ini file or what?


    thanks..

  2. #2
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    Remember HTML does not use newlines but <BR>

    If you view the page source you will see the newlines
    Thanks,

    Matt

  3. #3
    Join Date
    Jul 2002
    Location
    Burnaby
    Posts
    5
    So why is it then, that the PHP manual itself tells me to use escape characters to make newlines if I so choose? Look it up.. "echo()" in the help files.

    Now, if this is the case only when working with files, then it would have been nice to have the manual say straight up "yo, echo() with escaping characters won't transalte in HTML, doOd!"

    *shrug

    thanks for your reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •