Yojo网页设计

首页 新闻中心 网页教程 图形图像 设计欣赏 编程开发 程序教程 网站运营 数据库教程
·ASP教程·ASP.net教程·PHP教程·JSP教程·编程杂谈·AJAX·XML

您现在的位置: yojo网页设计 >> 编程开发 >> PHP教程 >> 正文

 

演示PHP如何使用模板生成静态页面

更新时间:2007-11-18 9:38:03 文章来源:互联网 .

简单演示PHP如何使用模板生成静态页面。

模板文件templets.htm:

<html>
  <head>
    <title>{title}</title>
  </head>
  <body>
    <p>Hello {hello}</p>
  </body>
</html>

 PHP文件代码:

<?php

  $title = 'webjx';
  $hello = 'webjxcom!';
  $file = file_get_contents('templets.htm');
  $file = str_replace(array('{title}','{hello}'),array($title,$hello), $file);
  echo $file;

?>


点击: 文章地址:http://www.518web.net/bckf/php/2364.html

热门点击

友情链接首页文字链接要求:PR≥4,搜索引擎正常收录,开通一年以上,内容健康充实的站点!申请...

Copyright(C) 2005-2008 518web.net,All Rights Reserve
Email:yojo.x@msn.com | 在线QQ:2306380 53614197| [浙ICP备08009643号]