What are the differences between using "\r", "\n", and "\r\n" for line breaks in PHP?

When working with text in PHP, it's important to understand the differences between "\r", "\n", and "\r\n" for line breaks. "\r" represents a carriage return, moving the cursor to the beginning of the line. "\n" represents a line feed, moving the cursor down to the next line. "\r\n" represents a combination of both, commonly used in Windows environments for line breaks. It's important to use the correct line break characters based on the platform you are working with to ensure proper formatting of text.

// Example of using different line break characters
$text = "Line 1\rLine 2\nLine 3\r\nLine 4";
echo $text;