<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Wordpress外贸企业主题, Wp企业主题, wordpress企业主题, wordpress主题定制,  PHP代码, ASP代码, 精选JS代码, WORDPRESS, 网站SEO,Flash焦点广告,JS焦点广告,CSS技巧 &#124; 九创主题 &#187; PHP生成HTML</title>
	<atom:link href="http://www.3code.cn/tag/php2html-tag/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.3code.cn</link>
	<description>Wordpress外贸企业主题, Wp企业主题, wordpress企业主题, wordpress主题定制,  PHP代码,ASP代码,精选JS代码,WORDPRESS,网站SEO,Flash焦点广告,JS焦点广告,CSS技巧</description>
	<lastBuildDate>Thu, 09 Feb 2012 01:52:35 +0000</lastBuildDate>
	<language>zh-cn</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>去除特殊字符生成URL的函数</title>
		<link>http://www.3code.cn/%e5%8e%bb%e9%99%a4%e7%89%b9%e6%ae%8a%e5%ad%97%e7%ac%a6%e7%94%9f%e6%88%90url%e7%9a%84%e5%87%bd%e6%95%b0/</link>
		<comments>http://www.3code.cn/%e5%8e%bb%e9%99%a4%e7%89%b9%e6%ae%8a%e5%ad%97%e7%ac%a6%e7%94%9f%e6%88%90url%e7%9a%84%e5%87%bd%e6%95%b0/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 08:24:34 +0000</pubDate>
		<dc:creator>寒林</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP 函数]]></category>
		<category><![CDATA[PHP生成HTML]]></category>

		<guid isPermaLink="false">http://www.3code.cn/?p=2240</guid>
		<description><![CDATA[去除特殊字符生成URL的函数]]></description>
			<content:encoded><![CDATA[<p>&lt;?<br />
//去除特殊字符的函数，目的是生成URL<br />
echo "输入: ".$_REQUEST["myfilename"]."&lt;br&gt;&lt;br&gt;";<br />
$myfilename=strtolower(str_replace(" ","-",trim($_REQUEST["myfilename"])));<br />
$myarp=array('.','+',',','，','。','%','&amp;','*','/','\\','|','=','(',')','^','$','#','@','!','~','`','/',';',':','"','[',']','{','}','&gt;','&lt;');<br />
for($i=0;$i&lt;=count($myarp);$i++)<br />
{$myfilename=str_replace($myarp[$i],"",$myfilename);<br />
}</p>
<p>echo "输出： ". $myfilename."&lt;br&gt;&lt;br&gt;";<br />
?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.3code.cn/%e5%8e%bb%e9%99%a4%e7%89%b9%e6%ae%8a%e5%ad%97%e7%ac%a6%e7%94%9f%e6%88%90url%e7%9a%84%e5%87%bd%e6%95%b0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用php生成excel和word文档</title>
		<link>http://www.3code.cn/php-excel-word/</link>
		<comments>http://www.3code.cn/php-excel-word/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 10:14:46 +0000</pubDate>
		<dc:creator>寒林</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP文件]]></category>
		<category><![CDATA[PHP生成HTML]]></category>

		<guid isPermaLink="false">http://www.3code.cn/?p=1238</guid>
		<description><![CDATA[header("Content-Disposition:filename=test.xls");
echo "test1\t";
echo "test2\t\n";
echo "test1\t";]]></description>
			<content:encoded><![CDATA[<p><strong>用php生成excel和word文档</strong><br />
&lt;?<br />
header("Content-type:application/vnd.ms-excel");<br />
header("Content-Disposition:filename=test.xls");<br />
echo "test1\t";<br />
echo "test2\t\n";<br />
echo "test1\t";<br />
echo "test2\t\n";<br />
echo "test1\t";<br />
echo "test2\t\n";<br />
echo "test1\t";<br />
echo "test2\t\n";<br />
echo "test1\t";<br />
echo "test2\t\n";<br />
echo "test1\t";<br />
echo "test2\t\n";<br />
?&gt;<br />
只需改动相应文件头就可以输出.doc .xls等文件格式</p>
]]></content:encoded>
			<wfw:commentRss>http://www.3code.cn/php-excel-word/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用php的ob_start来生成静态页面</title>
		<link>http://www.3code.cn/php-ob_start/</link>
		<comments>http://www.3code.cn/php-ob_start/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 02:55:43 +0000</pubDate>
		<dc:creator>寒林</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP 函数]]></category>
		<category><![CDATA[PHP生成HTML]]></category>

		<guid isPermaLink="false">http://www.3code.cn/?p=617</guid>
		<description><![CDATA[三个函数:ob_start()、ob_end_clean()、ob_get_contents() ob_start():是打开缓冲区的，就是要把您需要生成的静态文件的内容缓存在这里； ob_get_contents(): ]]></description>
			<content:encoded><![CDATA[<p><strong>用php的ob_start来生成静态页面</strong></p>
<p>三个函数:ob_start()、ob_end_clean()、ob_get_contents() ob_start():是打开缓冲区的，就是要把您需要生成的静态文件的内容缓存在这里； ob_get_contents():</p>
<p>ob_start():是打开缓冲区的，就是要把您需要生成的静态文件的内容缓存在这里；<br />
ob_get_contents():是读出缓冲区里的内容，下面有代码为例；<br />
ob_end_clean():这个比较重要，只有使用了这个函数后，缓冲区里的内容才会读取出来；复制内容到剪贴板代码:</p>
<p>if(file_exists("./index.htm"))//看静态index.htm文件是否存在<br />
{<br />
$time=time(); //文件修改时间和现在时间相差?的话，直接导向htm文件，否则重新生成htm<br />
if($time-filemtime("./index.htm")&lt; 600)<br />
{<br />
header("Location:classhtml/main.htm"); }<br />
}</p>
<p>//在你的开始处加入ob_start();CHINAZ</p>
<p>//首页内容，就是你的动态部分了</p>
<p>//在结尾加入ob_end_clean(),并把本页输出到一个变量中<br />
$temp=ob_get_contents();<br />
ob_end_clean();</p>
<p>//写入文件<br />
$fp=fopen("./index.htm",'w');<br />
fwrite($fp,$temp) or die('写文件错误');<br />
//echo"生成HTML完成！";</p>
]]></content:encoded>
			<wfw:commentRss>http://www.3code.cn/php-ob_start/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP生成HTML最简单实用的方法</title>
		<link>http://www.3code.cn/php2html/</link>
		<comments>http://www.3code.cn/php2html/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 09:33:40 +0000</pubDate>
		<dc:creator>寒林</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP生成HTML]]></category>

		<guid isPermaLink="false">http://www.3code.cn/?p=285</guid>
		<description><![CDATA[PHP生成HTML最简单的方法,些方法可以用于单个php文件生成html. 或者少量的html文件的生成。]]></description>
			<content:encoded><![CDATA[<p><strong>PHP生成HTML最简单实用的方法:</strong></p>
<p>PHP生成HTML最简单的方法,些方法可以用于单个php文件生成html. 或者少量的html文件的生成。<br />
<span style="color: #008000;"><span style="color: #ff0000;">&lt;?</span><br />
<span style="color: #ff9900;">//定义要您的域名</span><br />
$weburl="http://localhost/";</span></p>
<p><span style="color: #008000;"><span style="color: #ff9900;">//定义源程序模板文件，根据这个文件来生成html</span><br />
$fname=$weburl."main.php";<br />
<span style="color: #ff9900;">//获取源文件内容</span><br />
$content = file_get_contents($fname,"r");<br />
<span style="color: #ff9900;">//定义目标HTML文件</span><br />
$toname="../index.html";<br />
<span style="color: #ff9900;">//创建并写入目标文件</span><br />
$fp = fopen($toname,"w");<br />
fwrite($fp,$content);</span></p>
<p><span style="color: #008000;">echo"&lt;a href='javascript:history.back()'&gt;生成完毕! 请返回&lt;/a&gt;";<br />
<span style="color: #ff0000;">?&gt;</span></span></p>
<p><span style="color: #008000;"><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.3code.cn/php2html/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

