\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.
More Related Contents:
- How do I check if a string contains a specific word?
- Split a comma-delimited string into an array?
- startsWith() and endsWith() functions in PHP
- PHP – concatenate or directly insert variables in string
- Why does PHP consider 0 to be equal to a string?
- Using str_replace so that it only acts on the first match?
- Replacing accented characters php
- How to remove accents and turn letters into “plain” ASCII characters? [duplicate]
- Convert a comma-delimited string into array of integers?
- How do I remove all specific characters at the end of a string in PHP?
- How to get everything after a certain character?
- Get first 100 characters from string, respecting full words
- PHP remove special character from string
- Iterate over each line in a string in PHP
- Generate SEO friendly URLs (slugs) [closed]
- What is the most efficient way to count all the occurrences of a specific character in a PHP string?
- How can I remove part of a string in PHP? [closed]
- Find first character that is different between two strings
- PHP String Manipulation: Extract hrefs
- How to convert PascalCase to snake_case?
- PHP remove all characters before specific string
- Get last whole number in a string
- Include constant in string without concatenating
- Remove Trailing Slash From String PHP
- Most efficient way to get next letter in the alphabet using PHP
- Measure string size in Bytes in php
- Explode a paragraph into sentences in PHP
- Remove first 4 characters of a string with PHP
- PHP extract link from tag [duplicate]
- PHP Find all occurrences of a substring in a string