<?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>PHP生成HTML &#8211; 九创科技</title>
	<atom:link href="https://www.3code.cn/tag/php2html-tag/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.3code.cn</link>
	<description>Wordpress外贸企业主题, Wp企业主题, wordpress企业主题, wordpress主题定制, WORDPRESS外贸网站建设SEO</description>
	<lastBuildDate>Tue, 09 Nov 2010 08:24:34 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>去除特殊字符生成URL的函数</title>
		<link>https://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>
		
		<dc:creator><![CDATA[寒林]]></dc:creator>
		<pubDate>Tue, 09 Nov 2010 08:24:34 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP 函数]]></category>
		<category><![CDATA[PHP生成HTML]]></category>
		<guid isPermaLink="false">https://www.3code.cn/?p=2240</guid>

					<description><![CDATA[去除特殊字符生成URL的函数]]></description>
										<content:encoded><![CDATA[<p>&lt;?<br />
//去除特殊字符的函数，目的是生成URL<br />
echo &#8220;输入: &#8220;.$_REQUEST[&#8220;myfilename&#8221;].&#8221;&lt;br&gt;&lt;br&gt;&#8221;;<br />
$myfilename=strtolower(str_replace(&#8221; &#8220;,&#8221;-&#8220;,trim($_REQUEST[&#8220;myfilename&#8221;])));<br />
$myarp=array(&#8216;.&#8217;,&#8217;+&#8217;,&#8217;,&#8217;,&#8217;，&#8217;,&#8217;。&#8217;,&#8217;%&#8217;,&#8217;&amp;&#8217;,&#8217;*&#8217;,&#8217;/&#8217;,&#8217;\\&#8217;,&#8217;|&#8217;,&#8217;=&#8217;,'(&#8216;,&#8217;)&#8217;,&#8217;^&#8217;,&#8217;$&#8217;,&#8217;#&#8217;,&#8217;@&#8217;,&#8217;!&#8217;,&#8217;~&#8217;,&#8217;`&#8217;,&#8217;/&#8217;,&#8217;;&#8217;,&#8217;:&#8217;,'&#8221;&#8216;,'[&#8216;,&#8217;]&#8217;,'{&#8216;,&#8217;}&#8217;,&#8217;&gt;&#8217;,'&lt;&#8216;);<br />
for($i=0;$i&lt;=count($myarp);$i++)<br />
{$myfilename=str_replace($myarp[$i],&#8221;&#8221;,$myfilename);<br />
}</p>
<p>echo &#8220;输出： &#8220;. $myfilename.&#8221;&lt;br&gt;&lt;br&gt;&#8221;;<br />
?&gt;</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>用php生成excel和word文档</title>
		<link>https://www.3code.cn/php-excel-word/</link>
		
		<dc:creator><![CDATA[寒林]]></dc:creator>
		<pubDate>Wed, 09 Dec 2009 10:14:46 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP文件]]></category>
		<category><![CDATA[PHP生成HTML]]></category>
		<guid isPermaLink="false">https://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(&#8220;Content-type:application/vnd.ms-excel&#8221;);<br />
header(&#8220;Content-Disposition:filename=test.xls&#8221;);<br />
echo &#8220;test1\t&#8221;;<br />
echo &#8220;test2\t\n&#8221;;<br />
echo &#8220;test1\t&#8221;;<br />
echo &#8220;test2\t\n&#8221;;<br />
echo &#8220;test1\t&#8221;;<br />
echo &#8220;test2\t\n&#8221;;<br />
echo &#8220;test1\t&#8221;;<br />
echo &#8220;test2\t\n&#8221;;<br />
echo &#8220;test1\t&#8221;;<br />
echo &#8220;test2\t\n&#8221;;<br />
echo &#8220;test1\t&#8221;;<br />
echo &#8220;test2\t\n&#8221;;<br />
?&gt;<br />
只需改动相应文件头就可以输出.doc .xls等文件格式</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>用php的ob_start来生成静态页面</title>
		<link>https://www.3code.cn/php-ob_start/</link>
		
		<dc:creator><![CDATA[寒林]]></dc:creator>
		<pubDate>Sun, 22 Nov 2009 02:55:43 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP 函数]]></category>
		<category><![CDATA[PHP生成HTML]]></category>
		<guid isPermaLink="false">https://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(&#8220;./index.htm&#8221;))//看静态index.htm文件是否存在<br />
{<br />
$time=time(); //文件修改时间和现在时间相差?的话，直接导向htm文件，否则重新生成htm<br />
if($time-filemtime(&#8220;./index.htm&#8221;)&lt; 600)<br />
{<br />
header(&#8220;Location:classhtml/main.htm&#8221;); }<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(&#8220;./index.htm&#8221;,&#8217;w&#8217;);<br />
fwrite($fp,$temp) or die(&#8216;写文件错误&#8217;);<br />
//echo&#8221;生成HTML完成！&#8221;;</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PHP生成HTML最简单实用的方法</title>
		<link>https://www.3code.cn/php2html/</link>
		
		<dc:creator><![CDATA[寒林]]></dc:creator>
		<pubDate>Sat, 07 Nov 2009 09:33:40 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP生成HTML]]></category>
		<guid isPermaLink="false">https://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=&#8221;http://localhost/&#8221;;</span></p>
<p><span style="color: #008000;"><span style="color: #ff9900;">//定义源程序模板文件，根据这个文件来生成html</span><br />
$fname=$weburl.&#8221;main.php&#8221;;<br />
<span style="color: #ff9900;">//获取源文件内容</span><br />
$content = file_get_contents($fname,&#8221;r&#8221;);<br />
<span style="color: #ff9900;">//定义目标HTML文件</span><br />
$toname=&#8221;../index.html&#8221;;<br />
<span style="color: #ff9900;">//创建并写入目标文件</span><br />
$fp = fopen($toname,&#8221;w&#8221;);<br />
fwrite($fp,$content);</span></p>
<p><span style="color: #008000;">echo&#8221;&lt;a href=&#8217;javascript:history.back()&#8217;&gt;生成完毕! 请返回&lt;/a&gt;&#8221;;<br />
<span style="color: #ff0000;">?&gt;</span></span></p>
<p><span style="color: #008000;"><br />
</span></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
