← All docs

nl2br()

Inserts HTML line breaks before newlines in a string.

nl2br()

function nl2br(string $string): string

Inserts HTML line breaks before newlines in a string.

Parameters:

  • $string (string)

Returns: string

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how nl2br is implemented in the compiler, see the internals page.