Much better, thanks!
Well, PHP is actually right here, it expects a string as a parameter, and 0x00 is not a string, so it converts it to something that is a string (0x00 is a pretty bad case because 0 has so many meanings...).
Generally I'd advice to use a fixed-width font and the CSS rule white-space:pre; for comments, not just in IT files. The CSS rule will make sure that multiple space characters are not condensed into a single one, effectively destroying any kind of ASCII art. In that case, you also don't have to replace 0x0A and 0x0D anymore, as the browser will take care of it.
So, for comments...
.comments
{
white-space:pre;
font-family: Consolas, monospace; /* Consolas is a nice monospace font on Windows */
} And apply that to the comments section.