Inserts HTML line breaks before all newlines in a string
This code is very useful when we insert large content with number of new lines in the database table.In case of html line, it inserts <br /> for all \n.
<?php
echo nl2br("Hello \n World");
?>
Hello World