file highlighting upload form

This should give you back the highlighted source as valid XHTML 1.1

PHPs highlight_file function is a quick and dirty way to achieve basic syntax coloring, which can make your code a lot easier to read. The dirty part is its egregious use of icky invalid (at least for XHTML) font tags. Somebody wrote a note in the docs explaining how to fix this, but I found that the PHP.net site is using an even groovier method. Since the whole thing is open and available on CVS, it's just a matter of weeding out a bunch of extraneous junk to see what's going on.




Here's both the source of the script as well as an example. Reading the code is probably simpler than reading my feeble explanation. Feel free to steal it. I did. Well, mostly anyway.