function

nl2br . string . sncode

VERSIONlatest Inserts HTML line breaks before all newlines in a string

NL2BR(1e)

NAME

nl2br - Inserts HTML line breaks before all newlines in a string

SYNOPSIS

nl2br(string,is_xhtml = true)

PARAMETERS

string
The input string. is_xhtml = true Whenever a XHTML compatible line breaks or not.

RETURN

string
Returns the altered string.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

in:  res={_{nl2br("\n\ra\r\nb\rc\nd");}}.
out: res=<br />
\ra<br />\r
b<br />\rc<br />
d");.

in:  res={_{nl2br("\n\ra\r\nb\rc\nd",false);}}.
out: res=<br>
\ra<br>\r
b<br>\rc<br>
d");.

SEE ALSO

{{ include("includes/strings.sn") }}

AUTHOR

Written by Pusnei Sergey and Caroline Laplante, <sergey@sednove.com>