Description
Easy way to highlight stuff. Behaves just like highlight_string
Usage
$string = geshi_highlight( $string, $language, $path, $return );Parameters
- $string
- ( string ) required – The code to highlight
- $language
- ( string ) required – The language to highlight the code in
- $path
- ( string ) optional – 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
- $return
- ( boolean ) optional – Whether to return the result or to echo
Returns
string The code highlighted (if $return is true)Source
File name: oik-css/geshi/geshi.phpLines:
1 to 15 of 15
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; }View on GitHub View on Trac
Called by
Invoked by
Call hooks
API Letters:
