function gettemplatehtml($templatename,$escape=1) {
global $templatecache;
if($templatecache[$templatename]==""){
$gettemp=file("./template/$templatename");
$template = implode('',$gettemp);

if ($escape==1) {
$template=addslashes($template);
$template=str_replace("\\'","'",$template);
}

$templatecache[$templatename]=$template;
}
//return $template;
return $templatecache[$templatename];
}
eval("\$xxx= \"".gettemplatehtml("xxx.html")."\";");//把数据代入从模版:xxx.html为模版文件//生成HTML文件
$htmlfile=$yyy.".html";
$fp=fopen($htmlfile,"w+");
fputs($fp,$xxx);
fclose($fp);