Page 1 of 1

php highlighing

Posted: Tue Mar 23, 2004 7:44 pm
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...

Posted: Tue Mar 23, 2004 7:46 pm
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:

Posted: Tue Mar 23, 2004 7:48 pm
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.

Posted: Tue Mar 23, 2004 7:49 pm
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?

Posted: Tue Mar 23, 2004 7:56 pm
by Goowe
Color coding the syntax? (excuse my poor terminology)

Posted: Tue Mar 23, 2004 7:57 pm
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"; ?>

Posted: Tue Mar 23, 2004 8:05 pm
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