[Pmwiki-users] PHP Syntax Highlighting?

Thomas Werner fnord
Mon Jul 26 02:32:37 CDT 2004


Hello ML,

I thought it would be a very great feature if
php-sourcecode was automatically syntax-highlighted
by the wiki.
So I tried something like:


$InlineReplacements['/<\?php(.*)\?>/se'] = "php2wiki('$1')";

function php2wiki($txt) {
    return highlight_string( html_entity_decode (
       stripslashes($txt) ),true);
}

It works great on single lines, but not multiline.
Then I noticed, $InlineReplacements gets single lines
only, so this solution won't ever work.
How can I achieve automatic php syntax highglighting?
Is it possible without changing phpwiki.php just by
adding some script to scripts/ directory like I tried above?

Thomas



More information about the pmwiki-users mailing list