Hi :),

i tried your code zu replace some parts of a string,
the problem is that this method only replaces when
there is only 1 word between stringA and stringB.
i got the problem that the part between both strings
is a dynamic one and much larger then 1 word.
i really tried to use the php manual and google
to find some help for this, but i got no luck with that :(

$stringA = "AA";
$stringB = "BB";
$string = "AA oneword BB AA two words BB";

$pattern = "/$stringA.\w*.$stringB/";
$replacement = "";
echo preg_replace($pattern, $replacement, $string);

i think it have to do something with the \w in the pattern,
is there a parameter to resolve my problem too?


regards
manuel

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to