<?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>gry&#039;s blog&#187; PHP</title>
	<atom:link href="http://www.cngry.com/category/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.cngry.com</link>
	<description>grygrygrygrygrygrygrygrygry</description>
	<lastBuildDate>Sat, 30 Jul 2011 16:13:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PHP设置时区</title>
		<link>http://www.cngry.com/archives/php-set-timezone.html</link>
		<comments>http://www.cngry.com/archives/php-set-timezone.html#comments</comments>
		<pubDate>Mon, 12 Oct 2009 13:09:01 +0000</pubDate>
		<dc:creator>gry</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[时区]]></category>

		<guid isPermaLink="false">http://www.cngry.com/?p=455</guid>
		<description><![CDATA[PHP中用date获取的是服务器时间，如果你的服务器在中国，就不存在时差问题，如果在美国，就需设置默认时区，用以下代码即可解决。 ?Download php_set_timezone.txt1 2 3 4 &#60;?php date_default_timezone_set&#40;&#34;PRC&#34;&#41;; //将时区设为中国(PRC) $date=date&#40;&#34;Y-m-d H:i:s&#34;&#41;; ?&#62; Incoming search terms:php setcookie 时差 (1)<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能还喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="两个PHP在线测试工具" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.cngry.com%2Farchives%2Ftwo-php-online-test-tools.html&from=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-set-timezone.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/05/23/9234607.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">两个PHP在线测试工具</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="PHP中设置Session过期的方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-session-lifetime.html&from=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-set-timezone.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/03/13/3481598.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">PHP中设置Session过期的方法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="PHP计算时差" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-calculate-time-difference.html&from=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-set-timezone.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/03/13/3481598.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">PHP计算时差</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="一段PHP的UBB转换函数代码" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-ubb2html.html&from=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-set-timezone.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/03/13/3481598.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">一段PHP的UBB转换函数代码</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="本博客增加PHP分类" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fadd-category-php.html&from=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-set-timezone.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">本博客增加PHP分类</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><br />]]></description>
			<content:encoded><![CDATA[<p><span class='wp_keywordlink_affiliate'><a href="http://www.cngry.com/tag/php" title="查看 PHP 中的全部文章" target="_blank">PHP</a></span>中用date获取的是服务器时间，如果你的服务器在中国，就不存在时差问题，如果在美国，就需设置默认<span class='wp_keywordlink_affiliate'><a href="http://www.cngry.com/tag/%e6%97%b6%e5%8c%ba" title="查看 时区 中的全部文章" target="_blank">时区</a></span>，用以下代码即可解决。</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.cngry.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=455&amp;download=php_set_timezone.txt">php_set_timezone.txt</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4552"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p455code2"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<a href="http://www.php.net/date_default_timezone_set"><span style="color: #990000;">date_default_timezone_set</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;PRC&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">//将时区设为中国(PRC)</span>
<span style="color: #000088;">$date</span><span style="color: #339933;">=</span><a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y-m-d H:i:s&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h4>Incoming search terms:</h4><ul><li><a href="http://www.cngry.com/search/php-setcookie-%e6%97%b6%e5%b7%ae" title="php setcookie 时差">php setcookie 时差</a> (1)</li></ul><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能还喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="两个PHP在线测试工具" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.cngry.com%2Farchives%2Ftwo-php-online-test-tools.html&from=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-set-timezone.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/05/23/9234607.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">两个PHP在线测试工具</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="PHP中设置Session过期的方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-session-lifetime.html&from=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-set-timezone.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/03/13/3481598.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">PHP中设置Session过期的方法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="PHP计算时差" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-calculate-time-difference.html&from=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-set-timezone.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/03/13/3481598.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">PHP计算时差</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="一段PHP的UBB转换函数代码" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-ubb2html.html&from=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-set-timezone.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/03/13/3481598.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">一段PHP的UBB转换函数代码</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="本博客增加PHP分类" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fadd-category-php.html&from=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-set-timezone.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">本博客增加PHP分类</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.cngry.com/archives/php-set-timezone.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP计算时差</title>
		<link>http://www.cngry.com/archives/php-calculate-time-difference.html</link>
		<comments>http://www.cngry.com/archives/php-calculate-time-difference.html#comments</comments>
		<pubDate>Sat, 03 Oct 2009 01:44:43 +0000</pubDate>
		<dc:creator>gry</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[mktime]]></category>
		<category><![CDATA[时差]]></category>

		<guid isPermaLink="false">http://www.cngry.com/?p=431</guid>
		<description><![CDATA[计算时差不是件容易的事，因为日期-时间是多种进制混合在一起，需要转换成秒才能计算，比较麻烦，好在PHP提供了一个函数，能把一个时间（1970-2038之间的年）转换为相对 1970.01.01 0:0:0 的相对秒数值，这样就可以直接计算了。 函数格式：mktime(int hour, int minute, int second, int month, int day, int year); Code（时间用yymmddhhiiss格式，无空格，如：20090123095946） ?Download php-calc-shicha.txt1 2 3 4 5 6 7 function calc_shicha&#40;$t2,$t1&#41; &#123; $y=substr&#40;$t1,0,4&#41;;$m=substr&#40;$t1,4,2&#41;;$d=substr&#40;$t1,6,2&#41;;$h=substr&#40;$t1,8,2&#41;;$i=substr&#40;$t1,10,2&#41;;$s=substr&#40;$t1,12,2&#41;;//分离t1 $tt1=mktime&#40;$h,$i,$s,$m,$d,$y&#41;; $y=substr&#40;$t2,0,4&#41;;$m=substr&#40;$t2,4,2&#41;;$d=substr&#40;$t2,6,2&#41;;$h=substr&#40;$t2,8,2&#41;;$i=substr&#40;$t2,10,2&#41;;$s=substr&#40;$t2,12,2&#41;;//分离t2 $tt2=mktime&#40;$h,$i,$s,$m,$d,$y&#41;; return&#40;$tt2-$tt1&#41;; &#125;;<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能还喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="两个PHP在线测试工具" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.cngry.com%2Farchives%2Ftwo-php-online-test-tools.html&from=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-calculate-time-difference.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/05/23/9234607.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">两个PHP在线测试工具</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="PHP设置时区" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-set-timezone.html&from=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-calculate-time-difference.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/03/13/3481598.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">PHP设置时区</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="一段PHP的UBB转换函数代码" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-ubb2html.html&from=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-calculate-time-difference.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/03/13/3481598.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">一段PHP的UBB转换函数代码</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="PHP中设置Session过期的方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-session-lifetime.html&from=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-calculate-time-difference.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/03/13/3481598.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">PHP中设置Session过期的方法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="修改LiteSpeed主机的php参数" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.cngry.com%2Farchives%2Flitespeed-host-config-php.html&from=http%3A%2F%2Fwww.cngry.com%2Farchives%2Fphp-calculate-time-difference.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/04/08/5230788.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 45px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">修改LiteSpeed主机的php参数</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><br />]]></description>
			<content:encoded><![CDATA[<p>计算<span class='wp_keywordlink_affiliate'><a href="http://www.cngry.com/tag/%e6%97%b6%e5%b7%ae" title="查看 时差 中的全部文章" target="_blank">时差</a></span>不是件容易的事，因为日期-时间是多种进制混合在一起，需要转换成秒才能计算，比较麻烦，好在<span class='wp_keywordlink_affiliate'><a href="http://www.cngry.com/tag/php" title="查看 PHP 中的全部文章" target="_blank">PHP</a></span>提供了一个函数，能把一个时间（1970-2038之间的年）转换为相对 1970.01.01 0:0:0 的相对秒数值，这样就可以直接计算了。<br />
函数格式：<span class='wp_keywordlink_affiliate'><a href="http://www.cngry.com/tag/mktime" title="查看 mktime 中的全部文章" target="_blank">mktime</a></span>(int hour, int minute, int second, int month, int day, int year);<br />
Code（时间用yymmddhhiiss格式，无空格，如：20090123095946）</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.cngry.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=431&amp;download=php-calc-shicha.txt">php-calc-shicha.txt</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4314"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p431code4"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> calc_shicha<span style="color: #009900;">&#40;</span><span style="color: #000088;">$t2</span><span style="color: #339933;">,</span><span style="color: #000088;">$t1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$y</span><span style="color: #339933;">=</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$t1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$m</span><span style="color: #339933;">=</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$t1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$d</span><span style="color: #339933;">=</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$t1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$h</span><span style="color: #339933;">=</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$t1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$t1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$s</span><span style="color: #339933;">=</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$t1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">12</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//分离t1</span>
  <span style="color: #000088;">$tt1</span><span style="color: #339933;">=</span><a href="http://www.php.net/mktime"><span style="color: #990000;">mktime</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$h</span><span style="color: #339933;">,</span><span style="color: #000088;">$i</span><span style="color: #339933;">,</span><span style="color: #000088;">$s</span><span style="color: #339933;">,</span><span style="color: #000088;">$m</span><span style="color: #339933;">,</span><span style="color: #000088;">$d</span><span style="color: #339933;">,</span><span style="color: #000088;">$y</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$y</span><span style="color: #339933;">=</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$t2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$m</span><span style="color: #339933;">=</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$t2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$d</span><span style="color: #339933;">=</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$t2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$h</span><span style="color: #339933;">=</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$t2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$t2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$s</span><span style="color: #339933;">=</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$t2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">12</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//分离t2</span>
  <span style="color: #000088;">$tt2</span><span style="color: #339933;">=</span><a href="http://www.php.net/mktime"><span style="color: #990000;">mktime</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$h</span><span style="color: #339933;">,</span><span style="color: #000088;">$i</span><span style="color: #339933;">,</span><span style="color: #000088;">$s</span><span style="color: #339933;">,</span><span style="color: #000088;">$m</span><span style="color: #339933;">,</span><span style="color: #000088;">$d</span><span style="color: #339933;">,</span><span style="color: #000088;">$y</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tt2</span><span style="color: #339933;">-</span><span style="color: #000088;">$tt1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.cngry.com/archives/php-calculate-time-difference.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP中设置Session过期的方法</title>
		<link>http://www.cngry.com/archives/php-session-lifetime.html</link>
		<comments>http://www.cngry.com/archives/php-session-lifetime.html#comments</comments>
		<pubDate>Fri, 02 Oct 2009 01:16:41 +0000</pubDate>
		<dc:creator>gry</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[有效期]]></category>

		<guid isPermaLink="false">http://www.cngry.com/?p=426</guid>
		<description><![CDATA[Session的有效期是随浏览器进程的，浏览器关掉后就没了，那么怎么像Cookies那样设置过期时间呢？下面这段代码就可以实现。 ?Download session_cookies.txt1 2 3 4 5 &#60;?php $cookies_life_time = 24 * 3600; //过期时间，单位为秒，这里的设置即为一天 session_start&#40;&#41;; setcookie&#40;session_name&#40;&#41; ,session_id&#40;&#41;, time&#40;&#41; + $cookies_life_time, &#34;/&#34;&#41;; ?&#62;<br />]]></description>
			<content:encoded><![CDATA[<p>Session的<span class='wp_keywordlink_affiliate'><a href="http://www.cngry.com/tag/%e6%9c%89%e6%95%88%e6%9c%9f" title="查看 有效期 中的全部文章" target="_blank">有效期</a></span>是随浏览器进程的，浏览器关掉后就没了，那么怎么像Cookies那样设置过期时间呢？下面这段代码就可以实现。</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.cngry.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=426&amp;download=session_cookies.txt">session_cookies.txt</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4266"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p426code6"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$cookies_life_time</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">24</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">3600</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">//过期时间，单位为秒，这里的设置即为一天</span>
<a href="http://www.php.net/session_start"><span style="color: #990000;">session_start</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/setcookie"><span style="color: #990000;">setcookie</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/session_name"><span style="color: #990000;">session_name</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">,</span><a href="http://www.php.net/session_id"><span style="color: #990000;">session_id</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$cookies_life_time</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.cngry.com/archives/php-session-lifetime.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一段PHP的UBB转换函数代码</title>
		<link>http://www.cngry.com/archives/php-ubb2html.html</link>
		<comments>http://www.cngry.com/archives/php-ubb2html.html#comments</comments>
		<pubDate>Fri, 14 Aug 2009 05:08:58 +0000</pubDate>
		<dc:creator>gry</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[UBB]]></category>

		<guid isPermaLink="false">http://www.cngry.com/?p=281</guid>
		<description><![CDATA[?Download php-ubb2html.txt1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 [...]<br />]]></description>
			<content:encoded><![CDATA[
<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.cngry.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=281&amp;download=php-ubb2html.txt">php-ubb2html.txt</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2818"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
</pre></td><td class="code" id="p281code8"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> toubb<span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$str</span><span style="color: #339933;">=</span><a href="http://www.php.net/htmlspecialchars"><span style="color: #990000;">htmlspecialchars</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #666666; font-style: italic;">//$str = str_replace(&quot;file:&quot;,&quot;file :&quot;,$str);</span>
 <span style="color: #666666; font-style: italic;">//$str = str_replace(&quot;files:&quot;,&quot;files :&quot;,$str);</span>
 <span style="color: #666666; font-style: italic;">//$str = str_replace(&quot;script:&quot;,&quot;script :&quot;,$str);</span>
 <span style="color: #666666; font-style: italic;">//$str = str_replace(&quot;js:&quot;,&quot;js :&quot;,$str);</span>
&nbsp;
 <span style="color: #666666; font-style: italic;">//图片UBB</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\[img\](http|https|ftp):\/\/(.[^\[]*)\[\/img\]/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;a onfocus=<span style="color: #000099; font-weight: bold;">\&quot;</span>this.blur()<span style="color: #000099; font-weight: bold;">\&quot;</span> href=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}://<span style="color: #000099; font-weight: bold;">\$</span>{2}<span style="color: #000099; font-weight: bold;">\&quot;</span> target=new&gt;&lt;img src=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}://<span style="color: #000099; font-weight: bold;">\$</span>{2}<span style="color: #000099; font-weight: bold;">\&quot;</span> border=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span> alt=<span style="color: #000099; font-weight: bold;">\&quot;</span>按此在新窗口浏览图片<span style="color: #000099; font-weight: bold;">\&quot;</span> onload=<span style="color: #000099; font-weight: bold;">\&quot;</span>javascript:if(this.width&gt;300)this.width=300<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/a&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\[img=*([0-9]*),*([0-9]*)\](http|https|ftp):\/\/(.[^\[]*)\[\/img\]/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;a onfocus=<span style="color: #000099; font-weight: bold;">\&quot;</span>this.blur()<span style="color: #000099; font-weight: bold;">\&quot;</span> href=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{3}://<span style="color: #000099; font-weight: bold;">\$</span>{4}<span style="color: #000099; font-weight: bold;">\&quot;</span> target=new&gt;&lt;img src=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{3}://<span style="color: #000099; font-weight: bold;">\$</span>{4}<span style="color: #000099; font-weight: bold;">\&quot;</span> border=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span>  width=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span> heigh=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{2}<span style="color: #000099; font-weight: bold;">\&quot;</span> alt=<span style="color: #000099; font-weight: bold;">\&quot;</span>按此在新窗口浏览图片<span style="color: #000099; font-weight: bold;">\&quot;</span> onload=<span style="color: #000099; font-weight: bold;">\&quot;</span>javascript:if(this.width&gt;300)this.width=300<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/a&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/(\[img\])images\/face\/em(.*?)\.gif(\[\/img\])/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;img src=<span style="color: #000099; font-weight: bold;">\&quot;</span>images/face/em<span style="color: #000099; font-weight: bold;">\$</span>{2}.gif<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #666666; font-style: italic;">//链接UBB</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/(\[url\])(.[^\[]*)(\[url\])/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{2}<span style="color: #000099; font-weight: bold;">\&quot;</span> target=<span style="color: #000099; font-weight: bold;">\&quot;</span>new<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #000099; font-weight: bold;">\$</span>{1}&lt;/a&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\[url=(.[^\[]*)\]/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span> target=<span style="color: #000099; font-weight: bold;">\&quot;</span>new<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #666666; font-style: italic;">//邮箱UBB</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/(\[email\])(.*?)(\[\/email\])/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;img align=<span style="color: #000099; font-weight: bold;">\&quot;</span>absmiddle<span style="color: #000099; font-weight: bold;">\&quot;</span> <span style="color: #000099; font-weight: bold;">\&quot;</span>src=image/email1.gif<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span>mailto:<span style="color: #000099; font-weight: bold;">\$</span>{2}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #000099; font-weight: bold;">\$</span>{2}&lt;/a&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\[email=(.[^\[]*)\]/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;img align=<span style="color: #000099; font-weight: bold;">\&quot;</span>absmiddle<span style="color: #000099; font-weight: bold;">\&quot;</span> src=<span style="color: #000099; font-weight: bold;">\&quot;</span>image/email1.gif<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span>mailto:<span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span> target=<span style="color: #000099; font-weight: bold;">\&quot;</span>new<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #666666; font-style: italic;">//QQ号码UBB</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\[qq=([0-9]*)\]([0-9]*)\[\/qq\]/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;a target=<span style="color: #000099; font-weight: bold;">\&quot;</span>new<span style="color: #000099; font-weight: bold;">\&quot;</span> href=<span style="color: #000099; font-weight: bold;">\&quot;</span>tencent://message/?uin=<span style="color: #000099; font-weight: bold;">\$</span>{2}&amp;Site=www.52515.net&amp;Menu=yes<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;img border=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span> src=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://wpa.qq.com/pa?p=1:<span style="color: #000099; font-weight: bold;">\$</span>{2}:<span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span> alt=<span style="color: #000099; font-weight: bold;">\&quot;</span>点击这里给我发消息<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/a&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #666666; font-style: italic;">//颜色UBB</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\[color=(.[^\[]*)\]/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;font color=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #666666; font-style: italic;">//文字字体UBB</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\[font=(.[^\[]*)\]/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;font face=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #666666; font-style: italic;">//文字大小UBB</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\[size=([0-9]*)\]/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;font size=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\[size=([0-9]*)pt\]/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;font size=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\[size=([0-9]*)px\]/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;font size=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #666666; font-style: italic;">//文字对齐方式UBB</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\[align=(center|left|right)\]/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;div align=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #666666; font-style: italic;">//表格UBB</span>
 <span style="color: #666666; font-style: italic;">//$str = preg_replace(&quot;/\[table=(.[^\[]*)\]/i&quot;, &quot;&lt;table width=\&quot;\${1}\&quot; border=\&quot;1\&quot; style=\&quot;border-collapse:collapse\&quot;&gt;&quot;, $str);</span>
 <span style="color: #666666; font-style: italic;">//表格UBB2</span>
 <span style="color: #666666; font-style: italic;">//$str = preg_replace(&quot;/\[td=([0-9]*),([0-9]*),([0-9]*)\]/i&quot;, &quot;&lt;td colspan=\&quot;\${1}\&quot; rowspan=\&quot;\${2}\&quot; width=\&quot;\${3}\&quot;&gt;&quot;, $str);</span>
 <span style="color: #666666; font-style: italic;">//字体倾斜</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\[i\]((.|<span style="color: #000099; font-weight: bold;">\n</span>)*?)\[\/i\]/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;i&gt;<span style="color: #000099; font-weight: bold;">\$</span>{1}&lt;/i&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #666666; font-style: italic;">//FLASH动画UBB</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/(\[flash\])(http:\/\/.[^\[]*(.swf))(\[\/flash\])/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{2}<span style="color: #000099; font-weight: bold;">\&quot;</span> target=<span style="color: #000099; font-weight: bold;">\&quot;</span>new<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;img src=<span style="color: #000099; font-weight: bold;">\&quot;</span>image/swf.gif<span style="color: #000099; font-weight: bold;">\&quot;</span> border=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span> alt=<span style="color: #000099; font-weight: bold;">\&quot;</span>点击开新窗口欣赏该flash动画!<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span>16<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span>16<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;[全屏欣赏]&lt;/a&gt;&lt;br&gt;&lt;center&gt;&lt;object codebase=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0<span style="color: #000099; font-weight: bold;">\&quot;</span> classid=<span style="color: #000099; font-weight: bold;">\&quot;</span>clsid:d27cdb6e-ae6d-11cf-96b8-444553540000<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span>300<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span>200<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>movie<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{2}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>quality<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>high<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;embed src=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{2}<span style="color: #000099; font-weight: bold;">\&quot;</span> quality=<span style="color: #000099; font-weight: bold;">\&quot;</span>high<span style="color: #000099; font-weight: bold;">\&quot;</span> pluginspage=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash<span style="color: #000099; font-weight: bold;">\&quot;</span> type=<span style="color: #000099; font-weight: bold;">\&quot;</span>application/x-shockwave-flash<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span>300<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span>200<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #000099; font-weight: bold;">\$</span>{2}&lt;/embed&gt;&lt;/object&gt;&lt;/center&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/(\[flash=*([0-9]*),*([0-9]*)\])(http:\/\/.[^\[]*(.swf))(\[\/flash\])/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{4}<span style="color: #000099; font-weight: bold;">\&quot;</span> target=<span style="color: #000099; font-weight: bold;">\&quot;</span>new<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;img src=<span style="color: #000099; font-weight: bold;">\&quot;</span>image/swf.gif<span style="color: #000099; font-weight: bold;">\&quot;</span> border=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span> alt=<span style="color: #000099; font-weight: bold;">\&quot;</span>点击开新窗口欣赏该flash动画!<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span>16<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span>16<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;[全屏欣赏]&lt;/a&gt;&lt;br&gt;&lt;center&gt;&lt;object codebase=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0<span style="color: #000099; font-weight: bold;">\&quot;</span> classid=<span style="color: #000099; font-weight: bold;">\&quot;</span>clsid:d27cdb6e-ae6d-11cf-96b8-444553540000<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{2}<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{3}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>movie<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{4}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=quality value=high&gt;&lt;embed src=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{4}<span style="color: #000099; font-weight: bold;">\&quot;</span> quality=<span style="color: #000099; font-weight: bold;">\&quot;</span>high<span style="color: #000099; font-weight: bold;">\&quot;</span> pluginspage=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash<span style="color: #000099; font-weight: bold;">\&quot;</span> type=<span style="color: #000099; font-weight: bold;">\&quot;</span>application/x-shockwave-flash<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{2}<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{3}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #000099; font-weight: bold;">\$</span>{4}&lt;/embed&gt;&lt;/object&gt;&lt;/center&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #666666; font-style: italic;">//MEDIA PLAY播放UBB</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\[wmv\](.[^\[]*)\[\/wmv]/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;object align=<span style="color: #000099; font-weight: bold;">\&quot;</span>middle<span style="color: #000099; font-weight: bold;">\&quot;</span> classid=<span style="color: #000099; font-weight: bold;">\&quot;</span>clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95<span style="color: #000099; font-weight: bold;">\&quot;</span> class=<span style="color: #000099; font-weight: bold;">\&quot;</span>object<span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>mediaplayer<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span>300<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span>200<span style="color: #000099; font-weight: bold;">\&quot;</span> &gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>showstatusbar<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>-1<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>filename<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;embed type=<span style="color: #000099; font-weight: bold;">\&quot;</span>application/x-oleobject<span style="color: #000099; font-weight: bold;">\&quot;</span> codebase=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=5,1,52,701<span style="color: #000099; font-weight: bold;">\&quot;</span> flename=<span style="color: #000099; font-weight: bold;">\&quot;</span>mp<span style="color: #000099; font-weight: bold;">\&quot;</span> src=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span>  width=<span style="color: #000099; font-weight: bold;">\&quot;</span>300<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span>200<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/embed&gt;&lt;/object&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\[wmv=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/wmv]/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;object align=<span style="color: #000099; font-weight: bold;">\&quot;</span>middle<span style="color: #000099; font-weight: bold;">\&quot;</span> classid=<span style="color: #000099; font-weight: bold;">\&quot;</span>clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95<span style="color: #000099; font-weight: bold;">\&quot;</span> class=<span style="color: #000099; font-weight: bold;">\&quot;</span>object<span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>mediaplayer<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{2}<span style="color: #000099; font-weight: bold;">\&quot;</span> &gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>showstatusbar<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>-1<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>filename<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{3}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;embed type=<span style="color: #000099; font-weight: bold;">\&quot;</span>application/x-oleobject<span style="color: #000099; font-weight: bold;">\&quot;</span> codebase=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=5,1,52,701<span style="color: #000099; font-weight: bold;">\&quot;</span> flename=<span style="color: #000099; font-weight: bold;">\&quot;</span>mp<span style="color: #000099; font-weight: bold;">\&quot;</span> src=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{3}<span style="color: #000099; font-weight: bold;">\&quot;</span>  width=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{2}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/embed&gt;&lt;/object&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #666666; font-style: italic;">//REALPLAY 播放UBB</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\[rm\](.[^\[]*)\[\/rm]/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;object classid=<span style="color: #000099; font-weight: bold;">\&quot;</span>clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa<span style="color: #000099; font-weight: bold;">\&quot;</span> class=<span style="color: #000099; font-weight: bold;">\&quot;</span>object<span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>raocx<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span>300<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span>200<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>src<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>console<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>clip1<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>controls<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>imagewindow<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>autostart<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>true<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/object&gt;&lt;br&gt;&lt;object classid=<span style="color: #000099; font-weight: bold;">\&quot;</span>clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span>32<span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>video2<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span>300<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>src<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>autostart<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>-1<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>controls<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>controlpanel<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>console<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>clip1<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/object&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\[rm=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/rm]/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;object classid=<span style="color: #000099; font-weight: bold;">\&quot;</span>clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa<span style="color: #000099; font-weight: bold;">\&quot;</span> class=<span style="color: #000099; font-weight: bold;">\&quot;</span>object<span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>raocx<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{2}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>src<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{3}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>console<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>clip1<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>controls<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>imagewindow<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>autostart<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>true<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/object&gt;&lt;br&gt;&lt;object classid=<span style="color: #000099; font-weight: bold;">\&quot;</span>clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span>32<span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>video2<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>src<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{3}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>autostart<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>-1<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>controls<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>controlpanel<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>console<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>clip1<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/object&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;BR/&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\[rm=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/rm]/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;object classid=<span style="color: #000099; font-weight: bold;">\&quot;</span>clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa<span style="color: #000099; font-weight: bold;">\&quot;</span> class=<span style="color: #000099; font-weight: bold;">\&quot;</span>object<span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>raocx<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{2}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>src<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{3}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>console<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>clip1<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>controls<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>imagewindow<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>autostart<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>true<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/object&gt;&lt;br&gt;&lt;object classid=<span style="color: #000099; font-weight: bold;">\&quot;</span>clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa<span style="color: #000099; font-weight: bold;">\&quot;</span> height=<span style="color: #000099; font-weight: bold;">\&quot;</span>32<span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>video2<span style="color: #000099; font-weight: bold;">\&quot;</span> width=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{1}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>src<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\$</span>{3}<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>autostart<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>-1<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>controls<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>controlpanel<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;param name=<span style="color: #000099; font-weight: bold;">\&quot;</span>console<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>clip1<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;/object&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">/*
 re.pattern=&quot;\[code\]((.|\n)*?)\[\/code\]&quot;
 Set tempcodes=re.Execute($str)
 For i=0 To tempcodes.count-1
   re.pattern=&quot;&lt;BR/&gt;&quot;
   tempcode=Replace(tempcodes(i),&quot;&lt;BR/&gt;&quot;,vbcrlf)
   $str=replace($str,tempcodes(i),tempcode)
 next
*/</span>
    <span style="color: #000088;">$searcharray</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;[/url]&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;[/email]&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;[/color]&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;[/size]&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;[/font]&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;[/align]&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;[b]&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;[/b]&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;[u]&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;[/u]&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;[list]&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;[list=1]&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;[list=a]&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;[list=A]&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;[*]&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;[/list]&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;[indent]&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;[/indent]&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;[ DISCUZ_CODE_0 ]&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;[quote]&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;[/quote]&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;[tr]&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;[td]&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;[/td]&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;[/tr]&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;[/table]&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$replacearray</span><span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;/a&gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&lt;/a&gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&lt;/font&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;/font&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;/font&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;b&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;/b&gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&lt;u&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;/u&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;ul&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;ol type=1&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;ol type=a&gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&lt;ol type=A&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;li&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;/ul&gt;&lt;/ol&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;blockquote&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&lt;/blockquote&gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&lt;div&gt;&lt;textarea name=<span style="color: #000099; font-weight: bold;">\&quot;</span>codes<span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>codes<span style="color: #000099; font-weight: bold;">\&quot;</span> rows=<span style="color: #000099; font-weight: bold;">\&quot;</span>12<span style="color: #000099; font-weight: bold;">\&quot;</span> cols=<span style="color: #000099; font-weight: bold;">\&quot;</span>65<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&lt;/textarea&gt;&lt;br/&gt;&lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>button<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>运行代码<span style="color: #000099; font-weight: bold;">\&quot;</span> onclick=<span style="color: #000099; font-weight: bold;">\&quot;</span>RunCode()<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt; &lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>button<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>复制代码<span style="color: #000099; font-weight: bold;">\&quot;</span> onclick=<span style="color: #000099; font-weight: bold;">\&quot;</span>CopyCode()<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt; &lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>button<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>另存代码<span style="color: #000099; font-weight: bold;">\&quot;</span> onclick=<span style="color: #000099; font-weight: bold;">\&quot;</span>SaveCode()<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt; &lt;input type=<span style="color: #000099; font-weight: bold;">\&quot;</span>button<span style="color: #000099; font-weight: bold;">\&quot;</span> value=<span style="color: #000099; font-weight: bold;">\&quot;</span>跳&amp;nbsp;&amp;nbsp;转<span style="color: #000099; font-weight: bold;">\&quot;</span> onclick=<span style="color: #000099; font-weight: bold;">\&quot;</span>Goto(prompt('请输入要跳转到第几行？','1'))<span style="color: #000099; font-weight: bold;">\&quot;</span>  accesskey=<span style="color: #000099; font-weight: bold;">\&quot;</span>g<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt; &amp;nbsp;提示：您可以先修改部分代码再运行&lt;/div&gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&lt;div style=<span style="color: #000099; font-weight: bold;">\&quot;</span>background:#E2F2FF;width:90%;height:auto;border:1px solid #3CAAEC;padding:5px;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&lt;tr&gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&lt;td&gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&lt;/td&gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&lt;/tr&gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&lt;/table&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span>count<span style="color: #009900;">&#40;</span><span style="color: #000088;">$searcharray</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$searcharray</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$replacearray</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #b1b100;">return</span> <span style="color: #000088;">$str</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">/*
 're.Pattern=&quot;\[UPLOAD=(gif|jpg|jpeg|bmp)\](.[^\[]*)(gif|jpg|jpeg|bmp)\[\/UPLOAD\]&quot;
 '$str= re.Replace($str,&quot;&lt;br&gt;&lt;IMG SRC=\&quot;image/$1.gif\&quot; border=0&gt;此主题相关链接如下：&lt;br&gt;&lt;A HREF=\&quot;$2$1\&quot; TARGET=_blank&gt;&lt;IMG SRC=\&quot;$2$1\&quot; border=0 alt=按此在新窗口浏览图片 onload=\&quot;javascript:if(this.width&gt;screen.width-333)this.width=screen.width-333\&quot;&gt;&lt;/A&gt;&quot;)
 're.Pattern=&quot;\[UPLOAD=(doc|xls|ppt|htm|swf|rar|zip|exe)\](.[^\[]*)(doc|xls|ppt|htm|swf|rar|zip|exe)\[\/UPLOAD\]&quot;
 '$str= re.Replace($str,&quot;&lt;br&gt;&lt;IMG SRC=\&quot;image/$1.gif\&quot; border=0&gt;此主题相关链接如下：&lt;br&gt;&lt;a href=\&quot;$2$1\&quot; target='_blank'&gt;点击浏览该文件&lt;/a&gt;&quot;)
 '自动识别网址
 're.Pattern = &quot;^((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&amp;_~`@[\]\':+!]+)&quot;
 '$str = re.Replace($str,&quot;&lt;img align=absmiddle src=image/url.gif border=0&gt;&lt;a target=_blank href=$1&gt;$1&lt;/a&gt;&quot;)
 're.Pattern = &quot;((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&amp;_~`@[\]\':+!]+)$&quot;
 '$str = re.Replace($str,&quot;&lt;img align=absmiddle src=image/url.gif border=0&gt;&lt;a target=_blank href=$1&gt;$1&lt;/a&gt;&quot;)
 're.Pattern = &quot;([^&gt;=\&quot;])((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&amp;_~`@[\]\':+!]+)&quot;
 '$str = re.Replace($str,&quot;$1&lt;img align=absmiddle src=image/url.gif border=0&gt;&lt;a target=_blank href=$2&gt;$2&lt;/a&gt;&quot;)
 '自动识别www等开头的网址
 're.Pattern = &quot;([^(http://|http:\\)])((www|cn)[.](\w)+[.]{1,}(net|com|cn|org|cc)(((\/[\~]*|\\[\~]*)(\w)+)|[.](\w)+)*(((([?](\w)+){1}[=]*))*((\w)+){1}([\&amp;](\w)+[\=](\w)+)*)*)&quot;
 '$str = re.Replace($str,&quot;&lt;img align=absmiddle src=image/url.gif border=0&gt;&lt;a target=_blank href=http://$2&gt;$2&lt;/a&gt;&quot;)
 're.Pattern=&quot;\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/SHADOW]&quot;
 '$str=re.Replace($str,&quot;&lt;div style=\&quot;width:$1;filter:shadow(color=$2, strength=$3)\&quot;&gt;$4&lt;/div&gt;&quot;)
 're.Pattern=&quot;\[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/GLOW]&quot;
 '$str=re.Replace($str,&quot;&lt;div style=\&quot;width:$1;filter:glow(color=$2, strength=$3)\&quot;&gt;$4&lt;/div&gt;&quot;)
*/</span></pre></td></tr></table></div>

<p style="margin:0;padding:0;height:1px;overflow:hidden;">
    <script type="text/javascript"><!--
        var wumiiSitePrefix = "http://www.cngry.com";
        var wumiiEnableCustomPos = true;
        var wumiiParams = "&#038;num=6&#038;mode=3&#038;displayInFeed=1&#038;version=1.0.5.5&#038;pf=WordPress3.3.1";
    //--></script><script type="text/javascript" src="http://widget.wumii.com/ext/relatedItemsWidget.htm"></script><a href="http://www.wumii.com/widget/relatedItems.htm" style="border:0;"><img src="http://static.wumii.com/images/pixel.png" alt="无觅相关文章插件，快速提升流量" style="border:0;padding:0;margin:0;" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cngry.com/archives/php-ubb2html.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

