Code:
$s="{This} is a {test} string";
preg_match_all ("/\{.*?\}/", $s, $output);
$re[0]="rep1";
$re[1]="rep2";
print preg_replace($output[0],$re,$s);
Why does this code print out:
{rep1} is a {rep2} string
instead of:
rep1 is a rep2 string
What is wrong?