programming faqs interview questions tech technical educational freshers guide preparation interviews hr telephonic
try another color:
try another fontsize: 60% 70% 80% 90%
Programming FAQs

How to replace newlines with line breaks in php

use nl2br function nl2br

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