Use nl2br() to Convert Newlines to HTML Line Breaks

Use nl2br() to Convert Newlines to HTML Line Breaks

The nl2br() function inserts HTML line breaks before all newlines in a string. This is useful for displaying user-generated content in HTML.

← Back to Tips List