(.+?)\<\/h1\>/',$r,$m)) $title = $m[1]; $tpl = array(); $tpl['project_name'] = $cfg['project_name']; $tpl['partner_id'] = $cfg['partner_id']; $tpl['title'] = $title; $tpl['body']= $r; $s = file_get_contents('design.html'); foreach ($tpl as $key=>$value) { $s = str_replace('{'.$key.'}',$value,$s); } echo $s; ?>