hallöchen wie der Titel schon aussagt hab ich ein Prob ( wobei ich meine das ich vllt. nur noch etwas schlaf in den Augen hab )
aber eventuell kann mir ja jemand auf die Sprünge helfen
ich hab eine funktion in einer funktion welche durch eval aufgerufen wird
beide funktionen liegen in einer Klasse nehme ich die funktionen aus der klasse läuft alles super
hier mal der betreffende teil der Klasse
PHP-Code:
class function {
// PHP Higlight CODE
function &phpHighlight($str) {
$str = preg_replace("/(\[)(php)(\])(\r\n)*(.*)(\[\/php\])/siU", "|highlight('\\5');|", $str);
$str = explode('|', $str);
eval("\$str[1] = $str[1];");
foreach($str as $elem) {
$result .= stripslashes($elem);
}
return $result;
function &highlight($code){
$code = str_replace('<?php', '', $code);
$code = str_replace('?>', '', $code);
$code = "<?phpn".$code."n?>";
$code = stripslashes($code);
$code = highlight_string($code, true);
$code = explode('
', $code);
$text = 'PHP-CODE:
<div style="width:60%;background-color:#e4e4e4;border:1px solid #bfbfbf;font-family:verdana;font-size:11px;">
';
for($x=0;$x<sizeof($code);$x++) {
$text .= ($x+1).''.$code[$x].'
';
}
$text .= '
</div>';
return $text;
}
}
}
rufe ich jetzt die Funktion phpHighlight auf bekomme ich folgenden Fehler
( das die function highlight nicht gefunden wird )
Fatal error: Call to undefined function highlight() in E:\WebSERVER\apachefriends\xampp\htdocs\standart\c lass\class.function.php(82) : eval()'d code on line 1
hoffe das jemand mir einen anstoss geben kann
gruss