Hi PHP gurus,
I'm developing a PHP site that will use a lot of source code excerpts from a MySQL database written in several different languages. I've been on many forums where you can use [] tags to make text bold or italicise it, etc. (Like the TGML on this site!)
How would I go about implementing this in PHP so I could use syntax colouring on the languages I am feeaturing.
For example I'd be able to type:
[cpp]
/****************************
* UserDefinedDataTypes.cpp *
****************************/
union mix_t{
long l;
struct {
short hi;
short lo;
} s;
char c[4];
} mix; // union variable
[/cpp]
and it would hightlight the syntax as though it were a c++ program.
Thanks for your time.
I'm developing a PHP site that will use a lot of source code excerpts from a MySQL database written in several different languages. I've been on many forums where you can use [] tags to make text bold or italicise it, etc. (Like the TGML on this site!)
How would I go about implementing this in PHP so I could use syntax colouring on the languages I am feeaturing.
For example I'd be able to type:
[cpp]
/****************************
* UserDefinedDataTypes.cpp *
****************************/
union mix_t{
long l;
struct {
short hi;
short lo;
} s;
char c[4];
} mix; // union variable
[/cpp]
and it would hightlight the syntax as though it were a c++ program.
Thanks for your time.