I have a large string and want to replace some
substrings in it.
This substrings are delimited by a pair of tags (all
substrings), say: <tag> and </tag>. i.e. There is the
<tag> tag at the beginning of the substring I want to
replace and a </tag> tag at the end. There are several
of this substrings along my large string.
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>. 
How do I get the desired result??

Another way that would work for me is if i can return
an array of all of the matches 
preg_match looks like it will do this [and then
matches can be referenced by using array[1], array[2]
etc. and array[0] holds ALL of the matches] however it
does not seem to be working...



Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail

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