<?php
function topic($input){
$BBCode = array("&" => "&",
"<" => "<",
">" => ">",
"[b]" => "<b>",
"[/b]" => "</b>",
"[i]" => "<i>",
"[/i]" => "</i>",
"[u]" => "<u>",
"[/u]" => "</u>",
"[img]" => "<img src='",
"[/img]" => "'>",
"[code]" => "<font style=\"padding:3px;\" color=\"#CC0000\" size=\"2\">Code:</font><br><div id='code'><tt>",
"
" => "</tt></div>",
"" => "<a href=>",
"" => "</a>");
$message = preg_replace('/[url]|[url=[a-zA-Z.:\/_-0-9#]+]|[\/url]/si', '', $message);
return nl2br($message);
$parsedtext = str_replace(array_keys($BBCode), array_values($BBCode), $input);
return nl2br($parsedtext);
return nl2br(strip_tags(stripslashes(htmlspecialchars($input))));
}
?> [/code]
so would it be kinda like that?