What is the correct function to use for converting line breaks in PHP?
When displaying text in HTML, line breaks represented by "\n" in PHP may not be rendered correctly. To convert these line breaks into HTML line breaks ("<br>"), you can use the nl2br() function in PHP. This function replaces all newline characters in a string with HTML line breaks, allowing the text to be displayed properly in an HTML document.
$text = "Hello\nWorld!";
echo nl2br($text);