October 2005
Intermediate to advanced
372 pages
11h 35m
English
nl2br()
string nl2br ( string str )The nl2br function inserts a HTML line break (<br />) before all new line characters. You should note that it does not replace the line breaks—the \n breaks are left intact. For example:
$mystr = "This is a test\nYes it is.";
$brstr = nl2br($mystr);
// set to "This is a test<br />\nYes it is."