CODE
<?php
function code( $input ){
$data[0] = "<?php include(\"shoutbox.php?no=";
$data[1] = "\"); ?>";
$find[0] = "/\[b\](.*?)\[\/b\]/i";
$find[1] = "/\[url\=(.*)\](.*)\[\/url\]/";
$find[2] = "/\[u\](.*?)\[\/u\]/i";
$find[3] = "/\[i\](.*?)\[\/i\]/i";
$find[4] = "/\[big\](.*?)\[\/big\]/i";
$find[5] = "/\[small\](.*?)\[\/small\]/i";
$find[6] = "/\[shoutbox]id=(.*)\[\/shoutbox\]/";
$replace[0] = "<b>$1</b>";
$replace[1] = "<a href=\"$1\">$2</a>";
$replace[2] = "<u>$1</u>";
$replace[3] = "<i>$1</i>";
$replace[4] = "<font size=\"5\">$1</font>";
$replace[5] = "<font size=\"2\">$1</font>";
$replace[6] = "$data[0]$1$data[1]";
$change = preg_replace($find, $replace, $input);
print $change;
}
code("[shoutbox]id=1[/shoutbox]");
?>
function code( $input ){
$data[0] = "<?php include(\"shoutbox.php?no=";
$data[1] = "\"); ?>";
$find[0] = "/\[b\](.*?)\[\/b\]/i";
$find[1] = "/\[url\=(.*)\](.*)\[\/url\]/";
$find[2] = "/\[u\](.*?)\[\/u\]/i";
$find[3] = "/\[i\](.*?)\[\/i\]/i";
$find[4] = "/\[big\](.*?)\[\/big\]/i";
$find[5] = "/\[small\](.*?)\[\/small\]/i";
$find[6] = "/\[shoutbox]id=(.*)\[\/shoutbox\]/";
$replace[0] = "<b>$1</b>";
$replace[1] = "<a href=\"$1\">$2</a>";
$replace[2] = "<u>$1</u>";
$replace[3] = "<i>$1</i>";
$replace[4] = "<font size=\"5\">$1</font>";
$replace[5] = "<font size=\"2\">$1</font>";
$replace[6] = "$data[0]$1$data[1]";
$change = preg_replace($find, $replace, $input);
print $change;
}
code("[shoutbox]id=1[/shoutbox]");
?>
In my code, the shoutbox doesnt work. The code is ment to replace [shoutbox]no= with <?php include("shoutbox.php?no= then replace [/shoutbox] with "); ?> which it does, but then the php code just appears in the sorce of the webpage. Does anyone know how to fix it?
Thanks


