[ACCEPTED]-How to resolve PHP PHP_EOL issue-php
\r\nfor your line breaks to 5 make Windows happy.
Don't use notepad.
PHP_EOL only 4 represents something per the system it's 3 running on. It cannot possibly simultaneously 2 represent every EOL sequence that each OS 1 uses.
PHP_EOL for text-file output.
IIRC it's 2 better to use
"\r\n" for best compatibility.
You 1 can
$var it if you want.
echo nl2br("your first line\n your second line");
You can read text log file to html with 1 line break. This works in Windows and Linux/Unix:
echo str_replace("\n", '<br>', file_get_contents($logfilename));
More Related questions