PHP Code Highlight Function | Bytes (2024)

Home Posts Topics Members FAQ

Karl Groves

Just wondering if anyone out there has a good function to highlight code.
PHP's highlight_strin g 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

Subscribe Reply

2 PHP Code Highlight Function | Bytes (1) 1492 PHP Code Highlight Function | Bytes (2)

Alvaro G. Vicario

*** 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_strin g 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

Karl Groves

"Alvaro G. Vicario" <we*******@NOSP AMdemogracia.co mwrote in
news:ux******** *************** *****@40tude.ne t:

*** 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_strin g 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 4908

How to highlight table cell on mouseDown?

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. I'd like this feedback to be the usual highlight on mouseDown, un-highlight on mouseUp, but I can't figure out how to do it. Help? Thanks in...

Javascript

5 10895

convert to VB .Net code - Highlight text using mshtml.IMarkupServices

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 appreciated. Thanks. Atara. ------------------------- Original code:

Visual Basic .NET

5 2395

is there a way to speed up this tablesort code?

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 screaming fast? function sortTable(id, col, rev) { // Get the table or table section to sort. var tblEl = document.getElementById(id);

Javascript

2 1158

Put results of a Function into HTML code

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> <%# DataBinder.Eval(Container.DataItem,"title_id") %> </ItemTemplate> </asp:TemplateColumn>

ASP.NET

2 4041

PHP won't interpret php code any more

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() ?> # /usr/local/bin/php -v

PHP

3 3003

How to highlight an item in a table...please help

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 highlighted. Here is the code that I have so far: document.getElementById('tableID').style.backgroundColor ="#000000";...

Javascript

1 3321

how to highlight a img position in js?

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 "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <title>UK Map Example</title> <body>

Javascript

2 4029

hangman game confused about code

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 online resources to help me. I have added alot of comments for what should be happening however is not happening. I also have a teacher that...

Javascript

7854

What is ONU?

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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...

General

7783

Changing the language in Windows 10

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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...

Windows Server

8296

Maximizing Business Potential: The Nexus of Website Design and Digital Marketing

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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...

Online Marketing

1 7878

The easy way to turn off automatic updates for Windows 10/11

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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...

Windows Server

6533

AI Job Threat for Devs

by: agi2029 |last post by:

Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...

Career Advice

3790

Trying to create a lan-to-lan vpn between two differents networks

by: TSSRALBI |last post by:

Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...

Networking - Hardware / Configuration

3806

Windows Forms - .Net 8.0

by: adsilva |last post by:

A Windows Forms form does not have the event Unload, like VB6. What one acts like?

Visual Basic .NET

1 2295

transfer the data from one system to another through ip address

by: 6302768590 |last post by:

Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

C# / C Sharp

1 1394

How to add payments to a PHP MySQL app.

by: muto222 |last post by:

How can i add a mobile payment intergratation into php mysql website.

PHP

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

To disable or enable advertisem*nts and analytics tracking please visit the page.

PHP Code Highlight Function | Bytes (2024)
Top Articles
Latest Posts
Article information

Author: Gregorio Kreiger

Last Updated:

Views: 6016

Rating: 4.7 / 5 (57 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Gregorio Kreiger

Birthday: 1994-12-18

Address: 89212 Tracey Ramp, Sunside, MT 08453-0951

Phone: +9014805370218

Job: Customer Designer

Hobby: Mountain biking, Orienteering, Hiking, Sewing, Backpacking, Mushroom hunting, Backpacking

Introduction: My name is Gregorio Kreiger, I am a tender, brainy, enthusiastic, combative, agreeable, gentle, gentle person who loves writing and wants to share my knowledge and understanding with you.