(
'|\[b\](.*?)\[/b\]|i',
'|\[i\](.*?)\[/i\]|i',
'|\[u\](.*?)\[/u\]|i',
'|\[color=([a-z]+)\](.*?)\[/color\]|i',
'|\[size=([0-9]+)\](.*?)\[/size\]|i',
'|\[url=(http://)?(.+?)\](.*?)\[/url\]|i',
'|\[youtube\](.*?)\[/youtube\]|i',
'|\[img\](.*?)\[/img\]|i',
'|\[php\](.*?)\[/php\]|i',
);
(
'<font style="font-weight: bold;">\1</font>',
'<font style="font-style: italic;">\1</font>',
'<font style="text-decoration: underline;">\1</font>',
'<font style="color: \1;">\2</font>',
'<font style="font-size: \1px;">\2</font>',
'<a href="http://\2" target=new>\3</a>',
'<iframe width="320" height="250" src="http://www.youtube.com/embed/\1" frameborder="0" allowfullscreen></iframe><br>',
'<a href="\1" target=new><img src="\1" width=150 height=130 style="border: 1px dashed red; margin-right: 5px;"></a><br>',
printphp('\1'),
);
function printphp ($code) {
for($x = 0
; $x < sizeof($explode) ; $x++) {
$line .= ($x+1)."<br>";
}
$code = '<table class="php"><tr><td class="phpline">'.$line.'</td><td class="phpcode">' . str_replace(array('<code>', '</code>', '<span style="'), array('', '', '<span style="font-size: inherit; '), highlight_string($code, true)) . '</td></tr></table>'; return $code;
}
Mam funkcję do bbcode i funkcję do kolorowania kodu php. I nie wiem dlaczego nie chce mi kolorować jak wsadzę do tablicy jak widać tutaj printphp('\1')... Tak ogólnie to działą wszystko dobrze...
Czy nikt nie wie jak to zrobić? w czym jest problem?
Ten post edytował szmerak 23.08.2011, 21:26:25