Questions
Two solutions for this:
PHP function nl2br():
nl2br()
e.g.,
echo nl2br("This\r\nis\n\ra\nstring\r"); // will output This<br /> is<br /> a<br /> string<br />
Wrap the input in <pre></pre> tags.
<pre></pre>
See: W3C Wiki - HTML/Elements/pre
~ Answered on 2011-02-19 05:20:18