I've got part of the following in a script i call
function bbcode($bcode)
{
$bcode = preg_replace("#\[ PHP\](.*?)\[ /PHP\]#sie", "'<div>'.highlight_string(stripslashes('$1'), true).'</div>'", $bcode);
return $bcode;
}
*without the spaces where [ PHP] is.
Now if i go to the textarea and type the following;
[ PHP]<?php
echo $me;?>[ /PHP]
*again without the spaces where [ PHP] is.
It displays color coded but like;
<?php <br>echo $me;?>
But the <br> shouldnt be there. and if i add str_replace('<br>', '', $bcode);
if i had
<? echo $me; echo "<br>";?>
That <br> would be gone
any suggestions?