Mailinglisten-Archive |
> > Ich möchte das aus [u][b][i]Text[/i][/b][/u]
> > <u><b><i>Text</i></b></u> wird
> > wie kriege ich das nun hin das die reihenfolge egal ist?
> vielleicht hab ich dein problem nicht richtig erfasst,
> aber folgendes sollte auf jeden fall (ohne regex) klappen:
> $text = '[u][b][i]Text[/i][/b][/u]';
> $text = str_replace('[u]',<u>,$text);
> $text = str_replace('[b]',<b>,$text);
> $text = str_replace('[i]',<i>,$text);
> $text = str_replace('[/u]',</u>,$text);
> $text = str_replace('[/b]',</b>,$text);
> $text = str_replace('[/i]',</i>,$text);
oops,
wenn im Text kein [ und ] vorkommt, kuerzen wir jetzt mal:
$text = '[u][b][i]asdalavista[/i][/b][/u]';
$text = str_replace('[', '<', $text);
$text = str_replace(']', '>', $text);
m. b. G. Norbert
_____________________
normal: 02292-681769
Notruf: 0177-2363368
---------------------
e.o.m.
php::bar PHP Wiki - Listenarchive