PHP Syntax Highlighter

Online syntax highlighting

PHP has a great function that automatically highlights PHP code called highlight_string(); this could be used to roll your own code highlighting on a site. In this demo I’ll show you the basics of how it works, then extended it with a few tricks.