Replacing Line Breaks with HTML Breaks in PHP


Convert line breaks in a string to
HTML elements with nl2br().

Source Code

$text = "This isna stringnwith line breaks.";
echo nl2br($text);
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments