Buenas comunidad, de nuevo tengo otro problema con lo del bbcode xD, mi pregunta es: Se puede usar bbcode reemplazando un texto por una funcion que usa ese texto? Es decir, lo que quiero hacer es esto:
Código PHP:
<?php
function resaltarphp($texto)
{
$texto = html_entity_decode($texto); // Saco el htmlentities que use antes
$texto = highlight_string($texto); // Doy el highlight
return $texto; // Devuelvo el codigo resaltado
}
function bbcode($texto)
{
$texto = htmlentities($texto);
$texto = preg_replace("/\[php\](.*?)\[\/php\]/is","<fieldset class=\'php\'><legend>Codigo PHP: </legend>".resaltarphp($1)."</fieldset>", $texto);
return $texto;
}
?>
Pero cuando uso esa funcion, me este parse error:
Cita: Parse error: parse error, expecting `T_VARIABLE' or `'$'' in C:\wamp\www\foro desde 0\foro\editor\funciones.php on line 56
Les agradeceria mucho su ayuda
Saludos