PHP-Syntax-Highlighting - Farben ändern

Mit dieser Funktion kann man beim in PHP eingebauten Syntax-Highlighting die Farben verändern, ohne dass man Zugriff auf die php.ini hat. (Wie bei vielen Shared-Hosting-Angeboten)
<?php

function xhtml_highlight_string($str$returnString false)
{
   
$highlightComment '#FF8000';
   
$highlightDefault '#5533FF';
   
$highlightHtml    '#FFFFFF';
   
$highlightKeyword '#00BB00';
   
$highlightString  '#EE0000';

   
$res preg_replace( array (  '|<font color="' ini_get('highlight.comment') . '">(.*)</font>|Us',
                                 
'|<font color="' ini_get('highlight.default') . '">(.*)</font>|Us',
                                 
'|<font color="' ini_get('highlight.keyword') . '">(.*)</font>|Us',
                                 
'|<font color="' ini_get('highlight.string') . '">(.*)</font>|Us',
                                 
'|<font color="' ini_get('highlight.html') . '">(.*)</font>|Us'
                              
),
                        array (  
"<span style=\"color:$highlightComment\">\\1</span>",
                                 
"<span style=\"color:$highlightDefault\">\\1</span>",
                                 
"<span style=\"color:$highlightKeyword\">\\1</span>",
                                 
"<span style=\"color:$highlightString\">\\1</span>",
                                 
"<span style=\"color:$highlightHtml\">\\1</span>"
                              
),
                        
highlight_string $strtrue ) );
                        
   if ( 
$returnString )
      return 
$res;
   else
   {
      echo 
$res;
      return 
true;
   }
}

function 
xhtml_highlight_file $filename$returnString false )
{
   return 
xhtml_highlight_string file_get_contents $filename ), $returnString );
}

?>
deutsch english
Übersicht
Downloads
free game
SerpTrain
Physik-Studium
Schnipsel
Mail-Test
Gästebuch
Impressum
Valid HTML 4.01!
Valid CSS!
Get MySQL
Get PHP
Get Firefox
Get Thunderbird
© Michael "Serpedon" Walz

Parse error: syntax error, unexpected 'adminlogin' (T_STRING), expecting ')' in /kunden/125963_72135/webspace/serpedon.de/bbcloneBots/var/access.php on line 564