(.+?)<\/h1>/', $r, $m) ? $m[1] : ''; $tpl = array(); $tpl['project_name'] = $cfg['project_name']; $tpl['partner_id'] = $cfg['partner_id']; $tpl['title'] = $title; $tpl['body']= $r; $tpl['categories'] = preg_match('//', $r, $m) ? $m[1] : ''; $s = file_get_contents('design.html'); foreach ($tpl as $key => $value) { $s = str_replace('{'.$key.'}', $value, $s); } $s = preg_replace('//', '', $s); if (empty($title)) { header('HTTP/1.0 404 Not Found'); } echo $s; ?>