<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>猿氏悟语-程序猿问答 - 最新的问题和回复</title>
<link>http://wen.techweb.cc/qa</link>
<description>Powered by Question2Answer</description>
<item>
<title>以色列科技创业为什么这么发达？</title>
<link>http://wen.techweb.cc/26</link>
<description>这是很值得研究和学习的地方</description>
<guid isPermaLink="true">http://wen.techweb.cc/26</guid>
<pubDate>Tue, 15 May 2012 12:24:40 +0000</pubDate>
</item>
<item>
<title>php5 construct  destruct</title>
<link>http://wen.techweb.cc/25</link>
<description>&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
class User&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
function _construct($param1 , $param2){&lt;br /&gt;
&lt;br /&gt;
// construct statements go here&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
function _destruct($param1 , $param2){&lt;br /&gt;
&lt;br /&gt;
// destruct code&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;</description>
<guid isPermaLink="true">http://wen.techweb.cc/25</guid>
<pubDate>Sat, 17 Mar 2012 13:46:36 +0000</pubDate>
</item>
<item>
<title>回复于: php object clone</title>
<link>http://wen.techweb.cc/23?show=24#a24</link>
<description>结果输出为&lt;br /&gt;
&lt;br /&gt;
object1 name alice&lt;br /&gt;
&lt;br /&gt;
object2 name mimi</description>
<guid isPermaLink="true">http://wen.techweb.cc/23?show=24#a24</guid>
<pubDate>Sat, 17 Mar 2012 13:03:09 +0000</pubDate>
</item>
<item>
<title>回复于: Question2Answer与WordPress如何整合登录</title>
<link>http://wen.techweb.cc/16?show=17#a17</link>
<description>&lt;ul&gt;
	&lt;li&gt;
		下载最新版本的Question2Answer；&lt;/li&gt;
	&lt;li&gt;
		解压下载的压缩包文件；&lt;/li&gt;
	&lt;li&gt;
		在解压的question2answer文件夹中找到qa-config-example.php 文件并重命名为qa-config.php。&lt;/li&gt;
	&lt;li&gt;
		打开qa-config.php，在define(…)之外插入以下代码：&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;code&quot;&gt;
	define(‘QA_WORDPRESS_INTEGRATE_PATH’, ‘/PATH/TO/WORDPRESS’);&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		用WordPress在服务器上完整的安装路径替换文件中的/PATH/TO/WORDPRESS，此后不需要再设置MySQL数据库信息，程序会自动从WordPress导入。Question2Answer会与WordPress使用同一个数据库中不同的表。&lt;/li&gt;
	&lt;li&gt;
		将Question2Answer所有文件（包括 .htaccess）放置到网站服务器上，根目录或者网站的子目录都可以。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
	确保WordPressy认证cookies和与Question2Answer兼容的方法：&lt;/h3&gt;
&lt;p&gt;
	如果Question2Answer以WordPress网站的子目录形式安装（如http://wordpress.com/qa/和http://wordpress.com）则不需要额外设置；&lt;/p&gt;
&lt;p&gt;
	如果Question2Answer与WordPress安装在同一个域名，但不同目录下（如http://wordpress.com/qa/和 http://wordpress.com/blog），则需要在WordPress wp-config.php加入下面的代码：&lt;/p&gt;
&lt;p&gt;
	define(‘COOKIEPATH’, ‘/’);&lt;/p&gt;
&lt;p&gt;
	如果Question2Answer与WordPress安装在不同的子域名下，设置稍微复杂一些，在wp-config.php开始处添加下面的代码，并且将mysite.com用主域名替换：&lt;/p&gt;
&lt;p&gt;
	define(‘COOKIEPATH’, ‘/’);&lt;/p&gt;
&lt;p&gt;
	define(‘COOKIE_DOMAIN’, ‘.mysite.com’);&lt;/p&gt;
&lt;p&gt;
	还需要在wp-config.php末尾处加入下面的代码，并且将其中的qa.mysite.com用Question2Answer使用的子域名替换：&lt;/p&gt;
&lt;pre&gt;
/** To allow redirection from WordPress login to Question2Answer **/
add_filter('allowed_redirect_hosts', 'qa_wordpress_redirect_hosts');
function qa_wordpress_redirect_hosts($content) {
$content[] = 'qa.mysite.com';
return $content;
}
&lt;/pre&gt;
&lt;p&gt;
	使用浏览器访问Question2Answer的安装目录；&lt;/p&gt;
&lt;p&gt;
	按照页面提示继续安装；&lt;/p&gt;
&lt;p&gt;
	最后，创建主题以保持&lt;strong&gt;Question2Answer&lt;/strong&gt;和&lt;strong&gt;WorPress&lt;/strong&gt;在视觉上的统一性。&lt;/p&gt;
&lt;p&gt;
	来源：好资源网&lt;/p&gt;</description>
<guid isPermaLink="true">http://wen.techweb.cc/16?show=17#a17</guid>
<pubDate>Sun, 04 Mar 2012 14:58:04 +0000</pubDate>
</item>
<item>
<title>PHP函数参数可否提前,,,,,,,,,,,,,,,,,,,,,,,,,,</title>
<link>http://wen.techweb.cc/13</link>
<description>看到一个这样的写法，应该是错误的吧，&lt;br /&gt;
&lt;br /&gt;
类似这样一个函数&lt;br /&gt;
&lt;br /&gt;
function abc($a='',$b='',$c=''){&lt;br /&gt;
//代码&lt;br /&gt;
}&lt;br /&gt;
这个函数有三个参数,通常咋们正确的调用方法应该是这样的吧：&lt;br /&gt;
&lt;br /&gt;
abc($a,'',$c); &amp;nbsp;//$b参数为空，但位置保留&lt;br /&gt;
&lt;br /&gt;
今天看到一个写法是这样的：&lt;br /&gt;
&lt;br /&gt;
abc($a,$c='10'); &amp;nbsp;//$b参数的位置去掉然后直接指定C参数值；&lt;br /&gt;
&lt;br /&gt;
我测试了下不行，这里的C参数任然被复制给B参数；&lt;br /&gt;
&lt;br /&gt;
求个解释，我测试方法不对？还是？</description>
<guid isPermaLink="true">http://wen.techweb.cc/13</guid>
<pubDate>Sun, 19 Feb 2012 02:34:12 +0000</pubDate>
</item>
<item>
<title>回复于: PHP哈希表碰撞攻击原理是什么</title>
<link>http://wen.techweb.cc/9?show=12#a12</link>
<description>&lt;h2&gt;
	哈希算法&lt;/h2&gt;
&lt;p&gt;
	PHP哈希表最小容量是8（2^3），最大容 量是0×80000000（2^31），并向2的整数次幂圆整（即长度会自动扩展为2的整数次幂，如13个元素的哈希表长度为16；100个元素的哈希表 长度为128）。nTableMask被初始化为哈希表长度（圆整后）减1。具体代码在zend/Zend_hash.c的 _zend_hash_init函数中，这里截取与本文相关的部分并加上少量注释。&lt;/p&gt;
&lt;div&gt;
	&lt;div class=&quot;syntaxhighlighter notranslate actionscript3&quot; id=&quot;highlighter_237713&quot;&gt;
		&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
			&lt;tbody&gt;
				&lt;tr&gt;
					&lt;td class=&quot;gutter&quot;&gt;
						&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
							1&lt;/div&gt;
						&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
							2&lt;/div&gt;
						&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
							3&lt;/div&gt;
						&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
							4&lt;/div&gt;
						&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
							5&lt;/div&gt;
						&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
							6&lt;/div&gt;
						&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
							7&lt;/div&gt;
						&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
							8&lt;/div&gt;
						&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
							9&lt;/div&gt;
						&lt;div class=&quot;line number10 index9 alt1&quot;&gt;
							10&lt;/div&gt;
						&lt;div class=&quot;line number11 index10 alt2&quot;&gt;
							11&lt;/div&gt;
						&lt;div class=&quot;line number12 index11 alt1&quot;&gt;
							12&lt;/div&gt;
						&lt;div class=&quot;line number13 index12 alt2&quot;&gt;
							13&lt;/div&gt;
						&lt;div class=&quot;line number14 index13 alt1&quot;&gt;
							14&lt;/div&gt;
						&lt;div class=&quot;line number15 index14 alt2&quot;&gt;
							15&lt;/div&gt;
						&lt;div class=&quot;line number16 index15 alt1&quot;&gt;
							16&lt;/div&gt;
						&lt;div class=&quot;line number17 index16 alt2&quot;&gt;
							17&lt;/div&gt;
						&lt;div class=&quot;line number18 index17 alt1&quot;&gt;
							18&lt;/div&gt;
						&lt;div class=&quot;line number19 index18 alt2&quot;&gt;
							19&lt;/div&gt;
						&lt;div class=&quot;line number20 index19 alt1&quot;&gt;
							20&lt;/div&gt;
						&lt;div class=&quot;line number21 index20 alt2&quot;&gt;
							21&lt;/div&gt;
						&lt;div class=&quot;line number22 index21 alt1&quot;&gt;
							22&lt;/div&gt;
						&lt;div class=&quot;line number23 index22 alt2&quot;&gt;
							23&lt;/div&gt;
						&lt;div class=&quot;line number24 index23 alt1&quot;&gt;
							24&lt;/div&gt;
					&lt;/td&gt;
					&lt;td class=&quot;code&quot;&gt;
						&lt;div class=&quot;container&quot;&gt;
							&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
								&lt;code class=&quot;actionscript3 plain&quot;&gt;ZEND_API &lt;/code&gt;&lt;code class=&quot;actionscript3 keyword&quot;&gt;int&lt;/code&gt; &lt;code class=&quot;actionscript3 plain&quot;&gt;_zend_hash_init(HashTable *ht, &lt;/code&gt;&lt;code class=&quot;actionscript3 keyword&quot;&gt;uint&lt;/code&gt; &lt;code class=&quot;actionscript3 plain&quot;&gt;nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
								&lt;code class=&quot;actionscript3 plain&quot;&gt;{&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
								&lt;code class=&quot;actionscript3 spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;actionscript3 keyword&quot;&gt;uint&lt;/code&gt; &lt;code class=&quot;actionscript3 plain&quot;&gt;i = &lt;/code&gt;&lt;code class=&quot;actionscript3 value&quot;&gt;3&lt;/code&gt;&lt;code class=&quot;actionscript3 plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
								&lt;code class=&quot;actionscript3 spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;actionscript3 plain&quot;&gt;Bucket **tmp;&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
								&amp;nbsp;&lt;/div&gt;
							&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
								&lt;code class=&quot;actionscript3 spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;actionscript3 plain&quot;&gt;SET_INCONSISTENT(HT_OK);&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
								&amp;nbsp;&lt;/div&gt;
							&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
								&lt;code class=&quot;actionscript3 spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;actionscript3 comments&quot;&gt;//长度向2的整数次幂圆整&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
								&lt;code class=&quot;actionscript3 spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;actionscript3 keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;actionscript3 plain&quot;&gt;(nSize &amp;gt;= &lt;/code&gt;&lt;code class=&quot;actionscript3 value&quot;&gt;0x80000000&lt;/code&gt;&lt;code class=&quot;actionscript3 plain&quot;&gt;) {&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number10 index9 alt1&quot;&gt;
								&lt;code class=&quot;actionscript3 spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;actionscript3 comments&quot;&gt;/* prevent overflow */&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number11 index10 alt2&quot;&gt;
								&lt;code class=&quot;actionscript3 spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;actionscript3 plain&quot;&gt;ht-&amp;gt;nTableSize = &lt;/code&gt;&lt;code class=&quot;actionscript3 value&quot;&gt;0x80000000&lt;/code&gt;&lt;code class=&quot;actionscript3 plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number12 index11 alt1&quot;&gt;
								&lt;code class=&quot;actionscript3 spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;actionscript3 plain&quot;&gt;} &lt;/code&gt;&lt;code class=&quot;actionscript3 keyword&quot;&gt;else&lt;/code&gt; &lt;code class=&quot;actionscript3 plain&quot;&gt;{&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number13 index12 alt2&quot;&gt;
								&lt;code class=&quot;actionscript3 spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;actionscript3 keyword&quot;&gt;while&lt;/code&gt; &lt;code class=&quot;actionscript3 plain&quot;&gt;((1U &amp;lt;&amp;lt; i) &amp;lt; nSize) {&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number14 index13 alt1&quot;&gt;
								&lt;code class=&quot;actionscript3 spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;actionscript3 plain&quot;&gt;i++;&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number15 index14 alt2&quot;&gt;
								&lt;code class=&quot;actionscript3 spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;actionscript3 plain&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number16 index15 alt1&quot;&gt;
								&lt;code class=&quot;actionscript3 spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;actionscript3 plain&quot;&gt;ht-&amp;gt;nTableSize = &lt;/code&gt;&lt;code class=&quot;actionscript3 value&quot;&gt;1&lt;/code&gt; &lt;code class=&quot;actionscript3 plain&quot;&gt;&amp;lt;&amp;lt; i;&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number17 index16 alt2&quot;&gt;
								&lt;code class=&quot;actionscript3 spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;actionscript3 plain&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number18 index17 alt1&quot;&gt;
								&amp;nbsp;&lt;/div&gt;
							&lt;div class=&quot;line number19 index18 alt2&quot;&gt;
								&lt;code class=&quot;actionscript3 spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;actionscript3 plain&quot;&gt;ht-&amp;gt;nTableMask = ht-&amp;gt;nTableSize - &lt;/code&gt;&lt;code class=&quot;actionscript3 value&quot;&gt;1&lt;/code&gt;&lt;code class=&quot;actionscript3 plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number20 index19 alt1&quot;&gt;
								&amp;nbsp;&lt;/div&gt;
							&lt;div class=&quot;line number21 index20 alt2&quot;&gt;
								&lt;code class=&quot;actionscript3 spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;actionscript3 comments&quot;&gt;/*此处省略若干代码…*/&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number22 index21 alt1&quot;&gt;
								&amp;nbsp;&lt;/div&gt;
							&lt;div class=&quot;line number23 index22 alt2&quot;&gt;
								&lt;code class=&quot;actionscript3 spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;actionscript3 keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;actionscript3 plain&quot;&gt;SUCCESS;&lt;/code&gt;&lt;/div&gt;
							&lt;div class=&quot;line number24 index23 alt1&quot;&gt;
								&lt;code class=&quot;actionscript3 plain&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
						&lt;/div&gt;
					&lt;/td&gt;
				&lt;/tr&gt;
			&lt;/tbody&gt;
		&lt;/table&gt;
	&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
	值得一提的是PHP向2的整数次幂取圆整方法非常巧妙，可以背下来在需要的时候使用。&lt;/p&gt;
&lt;p&gt;
	Zend HashTable的哈希算法异常简单：&lt;/p&gt;
&lt;p&gt;
	&lt;img alt=&quot;&quot; src=&quot;http://latex.codecogs.com/gif.latex?hash%28key%29=key%5C&amp;amp;nTableMask&quot; title=&quot;hash(key)=key\&amp;amp;nTableMask&quot;&gt;&lt;/p&gt;
&lt;p&gt;
	即简单将数据的原始key与HashTable的nTableMask进行按位与即可。&lt;/p&gt;
&lt;p&gt;
	如果原始key为字符串，则首先使用&lt;a class=&quot;external&quot; href=&quot;http://blog.csdn.net/chen_alvin/article/details/5846714&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Times33&lt;/a&gt;算法将字符串转为整形再与nTableMask按位与。&lt;/p&gt;
&lt;p&gt;
	&lt;img alt=&quot;&quot; src=&quot;http://latex.codecogs.com/gif.latex?hash%28strkey%29=time33%28strkey%29%5C&amp;amp;nTableMask&quot; title=&quot;hash(strkey)=time33(strkey)\&amp;amp;nTableMask&quot;&gt;&lt;/p&gt;</description>
<guid isPermaLink="true">http://wen.techweb.cc/9?show=12#a12</guid>
<pubDate>Fri, 17 Feb 2012 00:43:57 +0000</pubDate>
</item>
<item>
<title>回复于: 亲爱的们，你是程序猿吗？</title>
<link>http://wen.techweb.cc/1?show=8#a8</link>
<description>&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;h1 style=&quot;font-size: 22px; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; color: rgb(0, 0, 0); font-family: Verdana, Arial, Helvetica, sans-serif; text-align: left;&quot;&gt;
	&lt;span class=&quot;entry-title&quot;&gt;亲爱的们，你是程序猿吗？&lt;/span&gt;&lt;/h1&gt;</description>
<guid isPermaLink="true">http://wen.techweb.cc/1?show=8#a8</guid>
<pubDate>Sat, 07 Jan 2012 17:29:57 +0000</pubDate>
</item>
<item>
<title>2012年计划学习一下python，谁来指导一下</title>
<link>http://wen.techweb.cc/6</link>
<description>&lt;p&gt;
	&lt;img alt=&quot;blush&quot; height=&quot;20&quot; src=&quot;http://wen.techweb.cc/qa-plugin/wysiwyg-editor/plugins/smiley/images/embaressed_smile.gif&quot; title=&quot;blush&quot; width=&quot;20&quot;&gt;&amp;nbsp; 我太笨，谁来提示一下啊&lt;/p&gt;</description>
<guid isPermaLink="true">http://wen.techweb.cc/6</guid>
<pubDate>Sat, 07 Jan 2012 14:45:15 +0000</pubDate>
</item>
<item>
<title>Dynamic PHP Redirect--php重定向</title>
<link>http://wen.techweb.cc/5</link>
<description>&lt;p&gt;
	302重定向&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;pre style=&quot;color: rgb(0, 0, 0); font-size: 13px; text-align: left; background-color: rgb(252, 252, 252);&quot;&gt;
&amp;lt;?php
header(&quot;Location: http://www.yourdomain.com/newpage.php&quot;);
exit;
?&amp;gt;

301重定向

&lt;/pre&gt;
&lt;pre&gt;
&amp;lt;?php
header(&quot;HTTP/1.1 301 Moved Permanently&quot;);
header(&quot;Location: http://www.yourdomain.com/newpage.php&quot;);
exit;
?&amp;gt;

按条件选择重定向

&lt;/pre&gt;
&lt;pre&gt;
&amp;lt;?php
$referer = $_SERVER['HTTP_REFERER'];
$domain_name = &quot;somedomain.com&quot;;
if(strpos($referer, $domain_name)!== FALSE) {
	header(&quot;HTTP/1.1 301 Moved Permanently&quot;);
	header(&quot;Location: http://www.yourdomain.com/newpage.php&quot;);
	exit;
}
?&amp;gt;&lt;/pre&gt;</description>
<guid isPermaLink="true">http://wen.techweb.cc/5</guid>
<pubDate>Sat, 07 Jan 2012 14:43:35 +0000</pubDate>
</item>
<item>
<title>回复于: php 文章列表分页，如何输出div排列</title>
<link>http://wen.techweb.cc/3?show=4#a4</link>
<description>这段代码，一直没发现哪里出错了</description>
<guid isPermaLink="true">http://wen.techweb.cc/3?show=4#a4</guid>
<pubDate>Sat, 07 Jan 2012 14:27:54 +0000</pubDate>
</item>
</channel>
</rss>
