I'm making a PHP bbcode for some blog software I'm making, and I'm trying to do this:
if(eregi("\[php\](.*|\n)\[/php\]", $content))
{
$content = eregi_replace("\[php\](.*|\n)\[/php\]", highlight_string(html_entity_decode("\\1", ENT_QUOTES), true), $content);
}
However entities aren't being decoded and no syntax highlighting is taking place. (Though it does wrap a code tag around it.)
This is the input I have:
[php[i][/i]][b]<[/b]?php
echo "Hello, world!";
?[b]>[/b]
[/CODE]
Can anyone tell me what's wrong?