<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[沧海一粟]]></title> 
<link>http://www.dzhope.com/index.php</link> 
<description><![CDATA[Web系统架构与服务器运维,php开发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[沧海一粟]]></copyright>
<item>
<link>http://www.dzhope.com/post//</link>
<title><![CDATA[php 生成HTML ]]></title> 
<author>jed &lt;jed521@163.com&gt;</author>
<category><![CDATA[代码编程]]></category>
<pubDate>Mon, 23 Oct 2006 05:19:14 +0000</pubDate> 
<guid>http://www.dzhope.com/post//</guid> 
<description>
<![CDATA[ 
	简单点,今天涉及到了这个方面的问题,动手吧!<br/>上网一找,我靠,一堆写得非常好的文章,但是我觉得写得太过AJAZ的!<br/>把思路整理一下,其实就很简单<br/>首先建给模版<br/><br/><br/>＜HTML&gt;＜TITLE&gt;{title}＜/TITLE&gt; ＜BODY&gt;{ file }＜/BODY&gt; ＜/HTML&gt;<br/><br/>测试用的就随便吧<br/>然后<br/><br/>$title = &quot;标题&quot;;<br/>$file = &quot;内容&quot;;<br/>$fp = fopen (&quot;1.html&quot;,&quot;rd&quot;); //打开模版,因为我是在windows下调试的所以参数要用到rd,在linux下就一个r<br/><br/>$size = filesize(&#039;1.html&#039;); //取得文件大小<br/><br/>$content = fread($fp,$size); //读取文件 fread的用法查下手册就明了啦!<br/><br/>$content = str_replace(&quot;{title}&quot;,$title,$content);//替换<br/>$content = str_replace(&quot;{ file }&quot;,$file,$content);//替换<br/>$path = &quot;/a.html&quot;;//输出文件的路径<br/>$handle=fopen($path,&quot;w&quot;); //写入方式打开路径<br/>fwrite($handle,$content); //把刚才替换的内容写进去,生成HTML文件<br/>fclose($handle); // 关掉他<br/>?&gt;<br/><br/><br/>OK<br/>如果还搞不明白,查手册去!查完就知道了! <br/><br/><br/>Tags - <a href="http://www.dzhope.com/tags/%25E7%2594%259F%25E6%2588%2590%25E9%259D%2599%25E6%2580%2581/" rel="tag">生成静态</a>
]]>
</description>
</item><item>
<link>http://www.dzhope.com/post//#blogcomment</link>
<title><![CDATA[[评论] php 生成HTML ]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.dzhope.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>