nl2br()

It inserts HTML line breaks before all newlines in a string

Example

<?php
echo nl2br(“phpncode “);
?>

Output

php
code

Share