here is my function for the highlight:
function highlight_php($matches) {
$php = "<strong>PHP Code:</strong><div style=\"margin:0px 10px; padding:5px; border:1px dotted #FFFFFF; width:90%\">";
$php .= highlight_string($matches[0], true);
$php .= '</div>';
$php = str_replace("<", '<', $php);
$php = str_replace("<br />", '', $php);
$php = preg_replace("@(\[php\]|\[/php\])@si", "", $php);
return $php;
}
i tried to str_replace the < back to < but it wouldnt work.
also i have this in my bbcode function:
$post = preg_replace_callback("@\[php\](.*?)\[\/php\]@is", 'highlight_php', $post);
any help would be great.
thanks,
venomsnake
edit: i think its the htmlspecialchars, i tried $php .= highlight_string(htmlspecialchars('<?php ?>'), true); and it did the same thing
Edited by venomsnake, 12 July 2006 - 10:45 PM.
