nl2br
The php documentation for nl2br states:
nl2br - Insert HTML line breaks before all newlines in a line
with an example:
Example # 1 Using nl2br ()
<?php
echo nl2br("foo isn't\n bar");
?>
The above example outputs:
foo isn't<br />
bar
just add nl2br after your echo:echo nl2br(.....);
source
share