Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Oct 2008
    Posts
    255
    Thanks
    113
    Thanked 0 Times in 0 Posts

    Newlines and Carriage Returns

    Why exactly do some many PHP scripts use both when outputting data? Don't they do the same thing?
    Last edited by Joseph Witchard; 12-20-2008 at 02:25 AM.

  • #2
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    Where is the \n in that query?

  • Users who have thanked masterofollies for this post:

    Joseph Witchard (12-20-2008)

  • #3
    Regular Coder
    Join Date
    Oct 2008
    Posts
    255
    Thanks
    113
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by masterofollies View Post
    Where is the \n in that query?
    The MySQLI query? That's just my forum signature. It has nothing to do with what I'm asking.

  • #4
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    You want the long answer?

    http://en.wikipedia.org/wiki/Newline

  • Users who have thanked Fumigator for this post:

    Joseph Witchard (12-20-2008)

  • #5
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    Oh I didn't know it was your signature

  • Users who have thanked masterofollies for this post:

    Joseph Witchard (12-20-2008)

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Quote Originally Posted by Fumigator View Post
    You want the long answer?

    http://en.wikipedia.org/wiki/Newline
    Short answer, simplicity. Lets you run it on different platforms and are ignored by ones that don't understand.

    Quote Originally Posted by masterofollies View Post
    Oh I didn't know it was your signature
    Yeah, its pretty hard to tell, especially with this being a coding forums (and code in signature). All thats there is the short line >.<

    As for outputting you're data, unless its on cli you don't need line feeds at all. They just make you're source code look nice
    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:

    Joseph Witchard (12-20-2008)

  • #7
    Regular Coder
    Join Date
    Oct 2008
    Posts
    255
    Thanks
    113
    Thanked 0 Times in 0 Posts
    Thanks


  •  

    Posting Permissions

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