Goto main content

nl2br

Inserts HTML line breaks before all newlines in a string

NL2BR

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>

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.