php highlighing

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

php highlighing

Post by John Cartwright »

I seen this many times before discussed on this forum but I can't find a tread relating to this on the forum. Can anyone give me a link to a thread of a tutorial that can show me how to do this..

reason being i want to display some scripts.. sort of as a tutorial...
Goowe
Forum Commoner
Posts: 94
Joined: Mon Mar 15, 2004 9:51 am
Location: Southeast Alaska

Post by Goowe »

As in... like someone types in a word to search and every word in a group of text is highlighted if it contains the word someone searched for?

Hmm... I've never tried it, but I'd love to know how it's done! I'm sure it'd be fun to play with :wink:
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

I think he means more like the stuff you see in between [syntax=php][/syntax] tags on this forum, ie highlight 'chunks' of php code for tutorial type purposes.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

hrmmm sort of but no

for example on this forum using the buttons.
All php syntax is highlighted.

Know what I mean?
Goowe
Forum Commoner
Posts: 94
Joined: Mon Mar 15, 2004 9:51 am
Location: Southeast Alaska

Post by Goowe »

Color coding the syntax? (excuse my poor terminology)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

yes that is what highlighing means

notice the difference

Code: Select all

<? echo "this is not highlighted"; ?>

Code: Select all

<? echo "this is highlighted"; ?>
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

use the highlight_string()
I posted a reply to a questionlike this on here but i couldn't find it... o well i found these:
1
2
Post Reply