I can't imagine why this would be (the comments in the documentation don't suggest anything), but if you're going to use str_replace(), you shouldn't forget the newline: str_replace("\n","<br>\n",$text). Without the newline, you'll end up with your entire block of text on a single line in the HTML (though it'll display correctly), which is fugly.