Menu Samaritan's Purse

NL2BR

Inserts HTML line breaks before all newlines in a string

SYNTAX

nl2br ( string $string [, bool $is_xhtml = TRUE ] ) : string

PARAMETERS

string

The input string.

is_xhtml

Whether to use XHTML compatible line breaks or not.

RETURN

Returns the altered string.

EXAMPLES

STRING

XHTML<br />
document<br />

IS_XHTML

HTML<br>
document<br>

NEWLINES

n<br />
nr<br />
r<br /> rn<br />
PHP_EOL<br />

PHP