What are the best practices for handling line breaks in PHP code?

When handling line breaks in PHP code, it is important to use the correct PHP_EOL constant to ensure cross-platform compatibility. This constant represents the appropriate line break character for the current operating system (e.g. \n for Unix-based systems, \r\n for Windows). By using PHP_EOL, you can ensure that your code will output line breaks correctly regardless of the platform it is running on.

// Using PHP_EOL to handle line breaks
$myText = "This is a line of text." . PHP_EOL;
$myText .= "This is another line of text." . PHP_EOL;

echo $myText;