Using preg_replace() to Replace Patterns
<? $test = "this is a test."; print preg_replace("/a test/", "another test", $test); ?>