i am not sure what you really mean, but to what i understand you are trying to look for a string named name='value' inside a string and replace them differently for each entry you find.
if thats correct, then you will need to have a while statement which loops untill no more entries are found (unique entries).
you could have while set on something like this:
while (ereg('string', 'replace_str', $arr_string))
.
.
// $arr_string[0] contains the current matched instance in the loop.
// so now you can use $arr_string[0] as your regex, for replacement.
$string = ereg($arr_string[0], 'replacce', 'string');
}
hope this idea helps.
Daarius...