473,395 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

PHP Code Highlight Function

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
2 1477
*** 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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: J Krugman | last post by:
I have set up an HTML table with clickable cells (the cells contain only text). They work fine, but I would like to give the user some visual feedback to indicate that a cell has been clicked. ...
5
by: Atara | last post by:
I am trying to convert the following code to VB .Net, I still have some gaps (the lines that are marked with (*)) and also I need an ending condition for the while loop. any help would be...
5
by: loc2006 | last post by:
I got this tablesort code from http://www.brainjar.com/dhtml/tablesort/default7.asp This is very slow for my table of 10 columns and 400 rows. Is there a way to optimize this code make it...
2
by: Henry Jones | last post by:
In ASP.NET 1.1, I have a Datagrid and I have the following column: <asp:TemplateColumn HeaderText="ID" ItemStyle-HorizontalAlign="Center" ItemStyle-BackColor="0066cc"> <ItemTemplate> <%#...
2
by: hup | last post by:
One of my Linux (CentOS) server stop interpret php code any more. I did try to compile and installed other version of php, but it's still not working. # cat /tmp/phpinfo.php <? phpinfo() ?>...
3
by: almurph | last post by:
Hi, I'm a newbie to Javascript. I can;t even finf a full API for it! Anyway I have a table structure and when a user presses the down-arrow button the item in said table is meant to be...
1
by: raja npedia | last post by:
Hello sir/madam, i have a one img file, in this file i search one keyword, suppose 'sample' , how to highlight this word in img file using javascript. i have one program , <!DOCTYPE HTML PUBLIC...
2
by: tesa | last post by:
I am not able to figure out how to make this work. I am trying to create a hangman game. I am in a basic javascripting class. I am to only use very basic code as you can see. I am able to use any...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.