hiho,
hab ein problem mit dem bbcode, also ich bekomms net umgesetzt in html.
hier is meine function zum übersetzten:
,
wenn ich dann,
dahin klatsche, wird der Text nicht mehr ausgegeben, wenn ich eins alleine replace funzt das auch alles, nur ich kann nicht mehrere codes umstückeln.
wo liegt das Problem???
p.s: Board Suche hab ich benutzt, aber die preg_replace is mir zu doof
danke im voraus
Edit: das \ in b, i,u und list nicht beachten
hab ein problem mit dem bbcode, also ich bekomms net umgesetzt in html.
hier is meine function zum übersetzten:
PHP-Code:
function replace_bbc($bbc)
{
str_replace("\n", "
", $bbc);
str_replace("[\b]", "[b]", $bbc);
str_replace("[/b]", "[/b]", $bbc);
str_replace("[\i]", "[i]", $bbc);
str_replace("[/i]", "[/i]", $bbc);
str_replace("[\u]", "<u>", $bbc);
str_replace("[/u]", "</u>", $bbc);
str_replace("[IMG]", "<img src=\"", $bbc);
str_replace("[/IMG]", "/\">", $bbc);
str_replace("[\list]", "<ul type=\"circle\">", $bbc);
str_replace("[/list]", "[/list]", $bbc);
str_replace("[*]", "[*]", $bbc);
str_replace("[**]", "", $bbc);
str_replace("[URL=\"", "<a href=\"", $bbc);
str_replace("\"]", "\">", $bbc);
str_replace("[/URL]", "</a>", $bbc);
str_replace("[MAIL=\"", "<a href=\"mailto:", $bbc);
str_replace("\"]", "\">", $bbc);
str_replace("[/MAIL]", "</a>", $bbc);
}
wenn ich dann,
PHP-Code:
replace_bbc($row['msg'])
wo liegt das Problem???
p.s: Board Suche hab ich benutzt, aber die preg_replace is mir zu doof
danke im voraus
Edit: das \ in b, i,u und list nicht beachten
Kommentar