PHP简单演示如何使用模板制作静态页面
2007-11-07 08:25:54 来源:网页教学网 站长整理
简单演示PHP如何使用模板生成静态页面。
模板文件templets.htm:
网页教学网
<html>
<head>
<title>{title}</title>
</head>
<body>
<p>Hello {hello}</p>
</body>
</html>
PHP文件代码: Webjx.Com
<?php
$title = 'webjx';
$hello = 'webjxcom!';
$file = file_get_contents('templets.htm'); Webjx.Com
$file = str_replace(array('{title}','{hello}'),array($title,$hello), $file);
echo $file;
?>
上一篇:设计理论:界面内容优化的层次






文章评论
共有 0 位网友发表了评论 查看完整内容