By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,661 Members | 779 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,661 IT Pros & Developers. It's quick & easy.

PHP Code Highlight Function

P: n/a
Just wondering if anyone out there has a good function to highlight code.
PHP's highlight_string function chokes whenever the string contains certain
characters. Most of the functions I've found through Googling work with
files. I'm looking for something that can handle a string.

TIA

--
Karl Groves
www.karlcore.com
Jul 11 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
*** Karl Groves escribió/wrote (Tue, 11 Jul 2006 07:45:11 -0500):
Just wondering if anyone out there has a good function to highlight code.
PHP's highlight_string function chokes whenever the string contains certain
characters. Most of the functions I've found through Googling work with
files. I'm looking for something that can handle a string.
Maybe it's too big for your purposes, but when I need to highlight code I
use Geshi:

http://qbnz.com/highlighter/

I can't remember whether it can be fed directly with a string but it cannot
you can simply write a child class.
--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
Jul 11 '06 #2

P: n/a
"Alvaro G. Vicario" <we*******@NOSPAMdemogracia.comwrote in
news:ux****************************@40tude.net:
*** Karl Groves escribió/wrote (Tue, 11 Jul 2006 07:45:11 -0500):
>Just wondering if anyone out there has a good function to highlight
code. PHP's highlight_string function chokes whenever the string
contains certain characters. Most of the functions I've found through
Googling work with files. I'm looking for something that can handle a
string.

Maybe it's too big for your purposes, but when I need to highlight
code I use Geshi:

http://qbnz.com/highlighter/

I can't remember whether it can be fed directly with a string but it
cannot you can simply write a child class.
That works perfectly. Thanks!
--
Karl Groves
www.karlcore.com
Jul 11 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.