pass arrays as parameter one and parameter two, and preg_replace() performs multiple replaces
<? $a = "Foo moo boo tool foo"; $b = preg_replace("/[A-Za-z]oo\b/e", 'strtoupper("$0")', $a); print $b; ?>