nl2br()
function nl2br(string $string): string
Inserts HTML line breaks before newlines in a string.
Parameters:
$string(string)
Returns: string
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/string/nl2br.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how nl2br is implemented in the compiler, see the internals page.