Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
Thread: Simple php question \n
02-08-2010, 03:10 AM #1
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"
thanksLast night I lay in bed looking up at the stars in the sky and I thought to myself, where the heck is the ceiling.
02-08-2010, 03:33 AM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,659 Times in 2,628 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.
header('HTTP/1.1 420 Enhance Your Calm');
Users who have thanked Fou-Lu for this post:
02-08-2010, 08:23 AM #3
- Join Date
- Mar 2006
- Thanked 37 Times in 37 Posts