AaronCameron.net
What's your point?
Not a Member? - Login or Create an Account...MC Offline
Saturday the 23rd of September 2017 @ 07:06am
Front Page Projects Your Profile About
[]

PHP Simple Source Highlighter

The simple source highlighter is a simple php include that will turn a string containing C/C++, PHP or Bash script source into colourized, syntax highlighted versions of the same.

This code isn't particularly pretty or complete, but it works and it's simple to integrate if you quickly want to generate html examples of your source.

For some examples of source highlighting check out the examples page. If you like what you see, you can download it from the downloads page.

To be completely upfront, this code isn't particularly bright. Escaped characters will screw up the highlighting (where they effect things like quotes) and complex structures are likely to be displayed wrong. If you want a robust and efficient syntax highlighter, move along. :)

©2017 Aaron Cameron