Tuesday, April 17, 2007

Colorize Code

CodeIgniter offers a really cool and handy helper function called highlight_code(). It is a handy little function that allows you to pass it a string of text including HTML tags, PHP code ... etc and it returns a colorized version of that string highlighting the code and tags in distinct colors.

I wish I'd known abou this nifty function before when I was struggling with creating tutorial web pages that included HTML code and I longed find a way to highlight such code easily.