I'm tryin to add a php highlighting code to my comment board
This is the replace:
$msg = preg_replace("/([code=php])(.+)([\/php])/",highlight_code("//2"),$msg);
This is the highlight function:
function highlight_code($text)
{
ob_start();
highlight_string($text);
$newtext = ob_get_contents();
ob_end_clean();
return $newtext;
}
I'm getting an error at the preg_replace so I'm guessing it doesnt like the function in the replace or something what should I do?