How can I replace newline or \r\n with ?

There is already the nl2br() function that inserts <br> tags before new line characters: Example (codepad): <?php // Won’t work $desc=”Line one\nline two”; // Should work $desc2 = “Line one\nline two”; echo nl2br($desc); echo ‘<br/>’; echo nl2br($desc2); ?> But if it is still not working make sure the text $desciption is double-quoted. That’s because single … Read more