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
Hmm..good and useful. is it possible to use like., $var = "hi this is just for sample for testing \n nl2br method is useful or not in such a big string is assigned \n for a VARIABLE and passed as \n ARGUMENT to this?"
ReplyDeletenl2br($var);
whether it ll give me expected result?