The nl2br() function inserts HTML line breaks (<br> or <br />) in front of each newline (\n) in a string.
Example
<!DOCTYPE html> <html> <body> <?php echo nl2br("First line.\nSecond line."); ?> </body> </html>
Output
First line. Second line.
The nl2br() function inserts HTML line breaks (<br> or <br />) in front of each newline (\n) in a string.
<!DOCTYPE html> <html> <body> <?php echo nl2br("First line.\nSecond line."); ?> </body> </html>
First line. Second line.