No that is not what I need, that does not tell me what text was replaced it only gives me a full copy of the original.
Here is an example
$maintext = "<script>this is a sample</script>other odd text<script>more text to remove and replace</script>";
I need to be able to pull out
"this is a sample" and
"more text to remove and replace"
put those into variables, then replace then with say "##item1##" and "##item2##"
then do another routine, then come back and replace the
"##item1##" with the "this is a sample" variable.
Hope that helps explain what I need...