views:

69

answers:

3

I need to do source code formatting (similar to what Stack Overflow does), but on the server side. What options do I have? My serverside language could be PHP or JSP. Does google have a server version of syntaxhighlighter?

+1  A: 

I suggest you refer to this question for a PHP solution.

Franz
A: 

Try enscript. I use it to for syntax-highlighted printouts, but it also generates html, rtf and even ANSI codes.

$ enscript -w html -o program.html program.c

it's a standalone utility, so you can use it from any language.

codehead
A: 

Use GeSHi. With over 150 languages supported is my favourite syntax highlight solution for PHP :)

Napolux