PHP简单演示如何使用模板制作静态页面
时间:2007-11-12 来源:whxy5
简单演示PHP如何使用模板生成静态页面。
模板文件templets.htm:
{title}
Hello {hello}
PHP文件代码:
$title = 'webjx';
$hello = 'webjxcom!';
$file = file_get_contents('templets.htm');
$file = str_replace(array('{title}','{hello}'),array($title,$hello), $file);
echo $file;
?>
[url=http://www.webjx.com/php/20071107/php_662.html][/url]
模板文件templets.htm:
{title}
Hello {hello}
PHP文件代码:
$title = 'webjx';
$hello = 'webjxcom!';
$file = file_get_contents('templets.htm');
$file = str_replace(array('{title}','{hello}'),array($title,$hello), $file);
echo $file;
?>
[url=http://www.webjx.com/php/20071107/php_662.html][/url]
相关阅读 更多 +
排行榜 更多 +