@savvykmsJun 22.2011 — #The [B]pre[/B] tag works fine. You can also use CSS in most browsers nowadays to modify another element to do the same (see [URL=http://www.w3schools.com/CSS/pr_text_white-space.asp]here[/URL]).
@savvykmsJun 22.2011 — #You can always send the header content-type: text/plain if you want a whole page to be plaintext. Also, note that fixed-width fonts (monospace) are great if you intend whitespace behavior to include newline characters as line breaks.
@AJAXnubauthorJun 22.2011 — #Why are mono-space fonts better for that?
I'm checking this for a comment feature, so what I wanted to do was to take in the information in a textarea, and then, on the server side, replace all of the rn characters with <br />, all < characters with < and all > characters with >. Does that cause any problems?
@savvykmsJun 22.2011 — #I just like monospace fonts; chances are if you care about newline characters being involved you care about lining up characters in a grid. I just thought it worth stating.
As for a comment feature, it is a simple matter in PHP to validate it and throw it onto a page. PHP has built-in functions: [URL=http://w3schools.com/php/func_string_htmlspecialchars.asp]htmlspecialchars()[/URL], [URL=http://w3schools.com/php/func_string_nl2br.asp]nl2br()[/URL]
@savvykmsJun 22.2011 — #I know C#, VC++, enough VB to get by, and a ton of other languages too. I tried learning ASP, but it seemed like an ineffiecient way of doing things to me. I do like the concent of a master file and some good object-orientation, but other than that I don't like ASP much.
C#: [code=php] String br = "<br />"; //turn the following into the proper System.String function notation replace("rn",br); replace("nr",br); replace("r",br); replace("n",br); [/code]
By replacing sequences (pairs) first, you eliminate the individual components of said pairs, then you can track down and replace individual components independant of pairs. E.g. you get rid of rn before you get rid of r and get rid of n, so that you don't get <br><br>