Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder cyrus709's Avatar
    Join Date
    Dec 2008
    Thanked 5 Times in 5 Posts

    Simple php question \n

    Alright this question should be extremely easy, however i have search the PHP manual for it and couldnt find an answer, im sure i have come across the answer at some point but never found it import enough to remember. Anyways now to the question what does "\n" mean or do in php?

    an example would be "false\n"

    Last night I lay in bed looking up at the stars in the sky and I thought to myself, where the heck is the ceiling.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Saskatoon, Saskatchewan
    Thanked 2,662 Times in 2,631 Posts
    \n is the generalized representation for a new line. You will sometimes see it coupled with a form feed: \r\n.
    In PHP, you can use a constant instead: PHP_EOL, so that it chooses the appropriate line end for the OS that its on (windows uses \n, Linux \r\n). This keeps you're file writing correct so that its more easily readable on the OS.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • Users who have thanked Fou-Lu for this post:

    cyrus709 (02-08-2010)

  • #3
    Regular Coder
    Join Date
    Mar 2006
    Thanked 37 Times in 37 Posts
    Also since you said you have searched the PHP Manual for the information, in the manual the information is given at this page (please see the table "Escaped characters").

  • Users who have thanked SKDevelopment for this post:

    cyrus709 (02-08-2010)


    Posting Permissions

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