phpbar.de logo

Mailinglisten-Archive

[php] noch eine Frage zu preg_replace

[php] noch eine Frage zu preg_replace

Gregor Wolf php_(at)_phpcenter.de
Fri, 04 May 2001 13:05:09 +0200


>$str = "Eine Seite im <b> Internet </b> www.php3.com";
>$str = preg_replace("!<b>(.+)<\/b>!","<b>".strtoupper("\\1")."</b>",$str);
>                                                       ^^^^^ ??????
Description

( http://www.php.net/manual/en/function.preg-replace.php )

mixed preg_replace (mixed pattern, mixed replacement, mixed subject [, int 
limit])

Searches subject for matches to pattern and replaces them with replacement. 
If limit is specified, then only limit matches will be replaced; if limit 
is omitted or is -1, then all matches are replaced


"!<b>(.+)<\/b>!" kann ja nicht gefunden und replaced werden, versuch mal :
"<b>(.+)<\/b>"

Gregor






php::bar PHP Wiki   -   Listenarchive