$result_array = array(); foreach ($subject_array as $subject) { reset($regex_array); // Prepare to walk through these two arrays reset($replace_array); // in their internal array orders. while (list(,$regex) = each($regex_array)) { list(,$replacement) = each($replace_array); // The regex and replacemnet are ready, so apply to the subject . . . $subject = preg_replace($regex, $replacement, $subject); } // Having now been processed by all the regexes, we're done with this subject . . . $result_array[] = $subject; // . . . so append to the results array. } ----------------------------------------------------------------------------- Copyright 1997-2024 Jeffrey Friedl