PHP echo the equivalent of CR LF of Notepad

Problem solved: the string was passed in the POST parameter. Removing the \r.

You just have to do a str_replace("\n", "\r\n", $...);.


Do echo PHP_EOL;

That way it'll always display the correct linefeed/carriage return combination that's valid for the system you're on, since not all OSes use the same newline convention. (More information: PHP global constants.)


It's as simple as doing:

echo "\r\n";

(note the double quotes)

Tags:

Php

Encoding