I'm trying to echo it onto a black background so I uncommented these lines in the php.ini
highlight.string = #DD0000
highlight.comment = #FF9900
highlight.keyword = #007700
highlight.bg = #000000
highlight.default = #0000BB
highlight.html = #FFFFFF
changing the background to black an the html to white
My problem here i guess its it thinks the php is html i suppose because its echoing it all white ( http://www.tewlzbox.org to see )
I add the message into the database using addslashes then when i post it i do the following
$msg = stripslashes($msg);
$msg = htmlentities($msg);
$msg = nl2br($msg);
$msg = preg_replace("!\\[php\\](.+?)\\[/php\\]!is",highlight_code("\\\\1"), $msg);
Highlight code function:
function highlight_code($text)
{
ob_start();
echo " <font size=\\"1\\" face=\\"Verdana\\">PHP Code:</font>";
echo " <hr>\\n";
highlight_string($text);
echo " <hr>\\n";
echo " <br>\\n";
$newtext = ob_get_contents();
ob_end_clean();
return $newtext;
}