Are there any specific escape characters that need to be used when replacing line breaks in PHP?

When replacing line breaks in PHP, it is important to use the correct escape characters to ensure the desired output. The most common escape characters used for line breaks are "\n" for a Unix-style line break and "\r\n" for a Windows-style line break. These escape characters should be used when replacing line breaks in PHP to maintain the correct formatting of the text.

// Replace line breaks with Unix-style line break "\n"
$text = "Hello\nworld!";
$fixed_text = str_replace("\r\n", "\n", $text);

echo $fixed_text;