I’ve seen many developers use different methods to split a string by new lines, but i’m confused which is the correct:
\n is used for Unix systems (including Linux, and OSX).
\r\n is mainly used on Windows.
\r is used on really old Macs.
PHP_EOL constant is used instead of these characters for portability between platforms.
Answered By – icktoofay
Answer Checked By – Gilberto Lyons (BugsFixing Admin)