I’m doing a PHP site which displays code examples in various languages (C#, PHP, Perl, Ruby, etc.). Are there any PHP functions which add syntax coloring for these and other languages?
If not, I would at least like to find that one built-in PHP function which does syntax coloring for PHP code, can’t find it anymore. Thanks.
Why not do the syntax coloration in the client side?
Use prettify.js, its really versatile, Google Code and StackOverflow use it!
Check the test page for the supported languages.