nl2br
Inserts HTML line breaks before all newlines in a string
&reftitle.description;
stringnl2br
stringstring
booluse_xhtml&true;
Returns string with <br /> or
<br> inserted before all newlines (\r\n,
\n\r, \n and \r).
&reftitle.parameters;
string
The input string.
use_xhtml
Whether to use XHTML compatible line breaks or not.
&reftitle.returnvalues;
Returns the altered string.
&reftitle.examples;
Using nl2br
]]>
&example.outputs;
bar
]]>
Generating valid HTML markup using the use_xhtml parameter
]]>
&example.outputs;
This is my HTML document
]]>
Various newline separators
]]>
&example.outputs;
is
a
string
]]>
&reftitle.seealso;
htmlspecialchars
htmlentities
wordwrap
str_replace