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.
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.