What are the differences in line break usage between Linux/Unix, Macintosh, and Windows systems when coding in PHP?

When coding in PHP, the main difference in line break usage between Linux/Unix, Macintosh, and Windows systems is the characters used to represent a line break. Linux/Unix systems use the newline character "\n", Macintosh systems use the carriage return character "\r", and Windows systems use a combination of both "\r\n". To ensure cross-platform compatibility, it is recommended to use the PHP_EOL constant which represents the appropriate line break character based on the system.

// Using PHP_EOL constant for cross-platform compatibility
$myText = "This is a line of text" . PHP_EOL;
echo $myText;