use nl2br function
nl2br — Inserts HTML line breaks before all newlines in a string
Syntax : string nl2br ( string $string [, bool $is_xhtml = true ] )
$string = "Welcome \n to \n ProgrammingFAQS.com";
echo nl2br($string);
It replaces new line character with break(br) tag
Learn to Develop an iPhone or iPad App in 4 Weeks Learn the latest and greatest markup language in the market with Robin Nixon(HTML & HTML5) Now $29 Only(75% Off)
use nl2br function nl2br
Wed, 06/30/2010 - 16:32 — bandariuse nl2br function
nl2br — Inserts HTML line breaks before all newlines in a string
Syntax : string nl2br ( string $string [, bool $is_xhtml = true ] )
$string = "Welcome \n to \n ProgrammingFAQS.com";
echo nl2br($string);
It replaces new line character with break(br) tag