如何用数组替换字符串中的相同字符串实例?

bma*_*ter 1 php

$replaces = array('replace 1', 'replace thing 2', 'third replace');

$string = '{REPLACEME} sfsfsdfsdf {REPLACEME} sdfopjsd {REPLACEME} sdfsdf {REPLACEME}';
Run Code Online (Sandbox Code Playgroud)

{REPLACEME}用匹配替换替换每个连续的最简单方法是什么?

如果有更多的{REPLACEME}替换,它不应该触及额外{REPLACEME}的.

所以我想要的输出是我的例子:

replace 1 sfsfsdfsdf replace thing 2 sdfopjsd third replace sdfsdf {REPLACEME}
Run Code Online (Sandbox Code Playgroud)

Cra*_*ent 8

foreach($replaces as $rep) {
  $string = preg_replace('~\{REPLACEME\}~',$rep,$string,1);
}
Run Code Online (Sandbox Code Playgroud)