> >What I'm doing is using ereg_replace in this form:
> >$LargeString = ereg_replace("<tag>.*</tag>",
> >"replacement", "$LargeString");
> >but what I get is the string with the replacement in a
> >way I don't actually want. It replaces the part of the
> >string that begins with THE FIRST TAG <tag> and that
> >ends with THE LAST TAG </tag>.

Use preg_raplace and make it "ungreddy" using "?" :
$LargeString = preg_replace("|<tag>.*?</tag>|","replacement",


PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to