phpbar.de logo

Mailinglisten-Archive

AW: [php] Bitte um hilfe bei meinem preg_replace

AW: [php] Bitte um hilfe bei meinem preg_replace

Michael Schoenboeck liste-php at digitalhome.cc
Mon Mar 1 15:36:59 CET 2004


Hallo,

>   // UNDERLINED
>   $patterns[4] = "/\[u\]/"; $replacements[4] = "<u>";
>   $patterns[5] = "/\[\/u\]/"; $replacements[5] = "</u>";
> 
>   $text = preg_replace($patterns, $replacements, $_POST['text']);

So machs ich:
$text = $_POST['text'];
$text = preg_replace("(\[b\](.+?)\[/b\])is",'<b>$1</b>',$text);
$text = preg_replace("(\[u\](.+?)\[/u\])is",'<u>$1</u>',$text);
...

Lg
michael

--
Deine Online Community -> http://net4u.cc/
Chat, Foren, SMS, Mail, Web, Fun & more...


php::bar PHP Wiki   -   Listenarchive