GeSHi
From wikiZero
GeSHi - Generic Syntax Highlighter
Since MediaWiki is written in PHP, why not test GeSHi with some PHP code, straight out of the source of course!
<?php/*** Easy way to highlight stuff. Behaves just like highlight_string** @param string The code to highlight* @param string The language to highlight the code in* @param string The path to the language files. You can leave this blank if you need* as from version 1.0.7 the path should be automatically detected* @param boolean Whether to return the result or to echo* @return string The code highlighted (if $return is true)* @since 1.0.2*/function geshi_highlight($string, $language, $path = null, $return = false) {
$geshi = new GeSHi($string, $language, $path);
$geshi->set_header_type(GESHI_HEADER_NONE);
if ($return) {
return '<code>' . $geshi->parse_code() . '</code>';
}echo '<code>' . $geshi->parse_code() . '</code>';
if ($geshi->error()) {
return false;
}return true;
}}?>

