...

View Full Version : Simple php question \n



cyrus709
02-08-2010, 04:10 AM
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"

thanks :rolleyes:

Fou-Lu
02-08-2010, 04:33 AM
\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.

SKDevelopment
02-08-2010, 09:23 AM
Also since you said you have searched the PHP Manual for the information, in the manual the information is given at this page (http://www.php.net/manual/en/language.types.string.php) (please see the table "Escaped characters").



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum