tags:

views:

371

answers:

2

Obviously it's not "\r\n",which only fits windows,and will cause ^M on linux

A: 

a new line in php is just "\n". should work on all platforms.

AvatarOfChronos
Don't we all use "\r\n" on windows?
Shore
Using "\n" has always worked for me as a newline in php. and I've worked in both Linux and Windows environments.
AvatarOfChronos
+6  A: 

PHP_EOL

Matthew Flaschen
But isn't that the newline for the server OS, not the client?
Tom Haigh
Yes..., why would you need the newline of the client? For HTML, newlines don't matter. For most other cases, the protocol specifies which to use.
Matthew Flaschen