PHP syntax highlighting

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
nuke-x
Forum Newbie
Posts: 1
Joined: Thu Dec 18, 2003 12:03 pm
Location: Bed

PHP syntax highlighting

Post by nuke-x »

I am writing a source code section for my website and want the php code to be highlited. To do this i am using the function [php_man]highlight_string[/php_man] and its not going very well.

It is all brought from one variable, which inside that variable is a selection of text and then php code.

I want it sort of like the [ php] function on this forum.

If any one knows where how to do then please tell me. Thanks :D
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post by DuFF »

I've never tried anything like this but you could take a look at the code for the [ php] mod.

http://www.phpbb.com/phpBB/viewtopic.php?t=119512
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

...or use the code-searchengine on http://www.evilwalrus.com for it. There are a couple with various tweaks there to learn from.
User avatar
Derfel Cadarn
Forum Contributor
Posts: 193
Joined: Thu Jul 17, 2003 12:02 pm
Location: Berlin, Germany

Post by Derfel Cadarn »

Isn't it easier to just save the files you want to show with an .phps-extension?
I admit you'll need to store the same files twice (as .php and as .phps) and that it's a childish solution, but it's the safest I can think of!
Post Reply