$string = "This is a test"; echo ereg_replace (" is", "was", $string); echo ereg_replace (" ()is", "\\1was", $string); echo ereg_replace ("( ()is)", "\\2was", $string);
?php $string = "Ceci est un test"; echo ereg_replace (" est", "etait", $string); echo ereg_replace (" ()est ", "\\1etait", $string); echo ereg_replace ("( ()est)", "\\2etait", $string);?