1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
<? $arr = array("titel" => "hallo"); $text = 'blabla {$titel} blabla'; foreach ($arr as $key=>$value) { $text = preg_replace("/\{\$$key\}/Uism", $value, $text); } echo $text; ?>