<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: 使用php的五个小技巧</title>
	<atom:link href="http://www.ooso.net/archives/303/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ooso.net/archives/303</link>
	<description>Linux + Apache + Mysql + Php + Flash</description>
	<lastBuildDate>Wed, 11 Jan 2012 15:01:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: 元如枫</title>
		<link>http://www.ooso.net/archives/303/comment-page-1#comment-28746</link>
		<dc:creator>元如枫</dc:creator>
		<pubDate>Sat, 21 Mar 2009 04:36:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/303#comment-28746</guid>
		<description>多谢经验分享，收益良多，交换个友情链接，以后多向你请教问题啊。</description>
		<content:encoded><![CDATA[<p>多谢经验分享，收益良多，交换个友情链接，以后多向你请教问题啊。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: volcano</title>
		<link>http://www.ooso.net/archives/303/comment-page-1#comment-12885</link>
		<dc:creator>volcano</dc:creator>
		<pubDate>Wed, 11 Jul 2007 10:51:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/303#comment-12885</guid>
		<description>str_replace替换字符本来就是有优势的

这个手册上都有写
&lt;blockquote&gt;If you don&#039;t need fancy replacing rules (like regular expressions), you should always use this function instead of ereg_replace() or preg_replace(). &lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<p>str_replace替换字符本来就是有优势的</p>
<p>这个手册上都有写</p>
<blockquote><p>If you don&#8217;t need fancy replacing rules (like regular expressions), you should always use this function instead of ereg_replace() or preg_replace(). </p></blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: longbill</title>
		<link>http://www.ooso.net/archives/303/comment-page-1#comment-12870</link>
		<dc:creator>longbill</dc:creator>
		<pubDate>Wed, 11 Jul 2007 04:37:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/303#comment-12870</guid>
		<description>str_replace( array ( &quot;字符串1&quot;, &quot;字符串2&quot;) , &quot;字符串3&quot;, &quot;原始字符串&quot;);
这样可以把 字符串1 字符串2 全部换为 字符串3

将数组传到str_replace中是字符替换最快的方法。（我测试过的）</description>
		<content:encoded><![CDATA[<p>str_replace( array ( &#8220;字符串1&#8243;, &#8220;字符串2&#8243;) , &#8220;字符串3&#8243;, &#8220;原始字符串&#8221;);<br />
这样可以把 字符串1 字符串2 全部换为 字符串3</p>
<p>将数组传到str_replace中是字符替换最快的方法。（我测试过的）</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: volcano</title>
		<link>http://www.ooso.net/archives/303/comment-page-1#comment-9977</link>
		<dc:creator>volcano</dc:creator>
		<pubDate>Sat, 09 Jun 2007 17:39:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/303#comment-9977</guid>
		<description>用定界符能把lambda函数写的比较漂亮，可读
效率方面，未做细致的测试，但就实际使用而言，效率损失不大</description>
		<content:encoded><![CDATA[<p>用定界符能把lambda函数写的比较漂亮，可读<br />
效率方面，未做细致的测试，但就实际使用而言，效率损失不大</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xLight</title>
		<link>http://www.ooso.net/archives/303/comment-page-1#comment-9945</link>
		<dc:creator>xLight</dc:creator>
		<pubDate>Sat, 09 Jun 2007 08:55:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/303#comment-9945</guid>
		<description>4. lambda函数

看起来不是很易读
而且应该不会有效率提升</description>
		<content:encoded><![CDATA[<p>4. lambda函数</p>
<p>看起来不是很易读<br />
而且应该不会有效率提升</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 边缘</title>
		<link>http://www.ooso.net/archives/303/comment-page-1#comment-9715</link>
		<dc:creator>边缘</dc:creator>
		<pubDate>Thu, 07 Jun 2007 01:45:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/303#comment-9715</guid>
		<description>喜欢浏览你的文章,总是给人惊喜!

加油!Fighting</description>
		<content:encoded><![CDATA[<p>喜欢浏览你的文章,总是给人惊喜!</p>
<p>加油!Fighting</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: piscdong</title>
		<link>http://www.ooso.net/archives/303/comment-page-1#comment-8639</link>
		<dc:creator>piscdong</dc:creator>
		<pubDate>Fri, 25 May 2007 04:25:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/303#comment-8639</guid>
		<description>原来这样也可以注释</description>
		<content:encoded><![CDATA[<p>原来这样也可以注释</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: volcano</title>
		<link>http://www.ooso.net/archives/303/comment-page-1#comment-8634</link>
		<dc:creator>volcano</dc:creator>
		<pubDate>Fri, 25 May 2007 03:12:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/303#comment-8634</guid>
		<description>留下一行不替换，这个很好解决，看下面的例子：

&lt;code&gt;
$replace = array(
&#039;某人&#039; =&gt; &#039;坏人&#039;,
//&#039;的&#039; =&gt; &#039;di&#039;,
&#039;栖息地&#039; =&gt; &#039;猪窝窝&#039;,
&#039;www.ooso.net&#039; =&gt; &#039;ooso.net&#039;
);
$str = str_replace(array_keys($replace), array_values($replace), $str);
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>留下一行不替换，这个很好解决，看下面的例子：</p>
<p><code><br />
$replace = array(<br />
'某人' => '坏人',<br />
//'的' => 'di',<br />
'栖息地' => '猪窝窝',<br />
'www.ooso.net' => 'ooso.net'<br />
);<br />
$str = str_replace(array_keys($replace), array_values($replace), $str);<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: volcano</title>
		<link>http://www.ooso.net/archives/303/comment-page-1#comment-8633</link>
		<dc:creator>volcano</dc:creator>
		<pubDate>Fri, 25 May 2007 03:10:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/303#comment-8633</guid>
		<description>to Mgccl:
一般的应用，瓶颈往往不在这种array或object上，往往是后端的db之类的会拖后腿。object对性能的影响反而可以忽略，俺在千万级的网站应用过，应无问题。

to piscdong:
广告评论太多，我不得以安装了Spam karma来屏蔽这些垃圾，副作用就是评论偶尔不太方便，应该不是每次都要输入验证码吧？我切换成未登录状态来验证这个问题，看看能否让评论的过程更顺畅。</description>
		<content:encoded><![CDATA[<p>to Mgccl:<br />
一般的应用，瓶颈往往不在这种array或object上，往往是后端的db之类的会拖后腿。object对性能的影响反而可以忽略，俺在千万级的网站应用过，应无问题。</p>
<p>to piscdong:<br />
广告评论太多，我不得以安装了Spam karma来屏蔽这些垃圾，副作用就是评论偶尔不太方便，应该不是每次都要输入验证码吧？我切换成未登录状态来验证这个问题，看看能否让评论的过程更顺畅。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: test</title>
		<link>http://www.ooso.net/archives/303/comment-page-1#comment-8632</link>
		<dc:creator>test</dc:creator>
		<pubDate>Fri, 25 May 2007 02:53:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/303#comment-8632</guid>
		<description>测试</description>
		<content:encoded><![CDATA[<p>测试</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: piscdong</title>
		<link>http://www.ooso.net/archives/303/comment-page-1#comment-8631</link>
		<dc:creator>piscdong</dc:creator>
		<pubDate>Fri, 25 May 2007 02:51:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/303#comment-8631</guid>
		<description>再说一下评论的用户体验
1、前面说的，用户信息没有记录，每次都要重填
2、提交评论后才要求填验证码，验证后没有自动返回，也没有提供返回的链接</description>
		<content:encoded><![CDATA[<p>再说一下评论的用户体验<br />
1、前面说的，用户信息没有记录，每次都要重填<br />
2、提交评论后才要求填验证码，验证后没有自动返回，也没有提供返回的链接</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mgccl</title>
		<link>http://www.ooso.net/archives/303/comment-page-1#comment-8630</link>
		<dc:creator>Mgccl</dc:creator>
		<pubDate>Fri, 25 May 2007 02:49:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/303#comment-8630</guid>
		<description>类型戏法很有意思...
array变成Object是爽了.
不过这个比较适合有string key的array.
Object是不是内存和速度方面都比不上array?</description>
		<content:encoded><![CDATA[<p>类型戏法很有意思&#8230;<br />
array变成Object是爽了.<br />
不过这个比较适合有string key的array.<br />
Object是不是内存和速度方面都比不上array?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: piscdong</title>
		<link>http://www.ooso.net/archives/303/comment-page-1#comment-8629</link>
		<dc:creator>piscdong</dc:creator>
		<pubDate>Fri, 25 May 2007 02:48:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/303#comment-8629</guid>
		<description>怎么不能记住作者信息，每次都要重填

比如说，&#039;的&#039; =&gt; &#039;di&#039;这一条想暂时不替换，但是以后可能会替换。用替换多次这种形式只要把这一行注释掉就可以了，以后再替换把注释删掉就可以了；替换一次这种形式就只能把这一行删掉，以后可能就忘了。

$str = str_replace(&#039;某人&#039;, &#039;坏人&#039;, $str);
//$str = str_replace(&#039;的&#039;, &#039;di&#039;, $str);
$str = str_replace(&#039;栖息地&#039;, &#039;猪窝窝&#039;, $str);
$str = str_replace(&#039;www.ooso.net&#039;, &#039;ooso.net&#039;, $str); 

$replace = array(
&#039;某人&#039; =&gt; &#039;坏人&#039;,
&#039;栖息地&#039; =&gt; &#039;猪窝窝&#039;,
&#039;www.ooso.net&#039; =&gt; &#039;ooso.net&#039;
);</description>
		<content:encoded><![CDATA[<p>怎么不能记住作者信息，每次都要重填</p>
<p>比如说，&#8217;的&#8217; =&gt; &#8216;di&#8217;这一条想暂时不替换，但是以后可能会替换。用替换多次这种形式只要把这一行注释掉就可以了，以后再替换把注释删掉就可以了；替换一次这种形式就只能把这一行删掉，以后可能就忘了。</p>
<p>$str = str_replace(&#8216;某人&#8217;, &#8216;坏人&#8217;, $str);<br />
//$str = str_replace(&#8216;的&#8217;, &#8216;di&#8217;, $str);<br />
$str = str_replace(&#8216;栖息地&#8217;, &#8216;猪窝窝&#8217;, $str);<br />
$str = str_replace(&#8216;www.ooso.net&#8217;, &#8216;ooso.net&#8217;, $str); </p>
<p>$replace = array(<br />
&#8216;某人&#8217; =&gt; &#8216;坏人&#8217;,<br />
&#8216;栖息地&#8217; =&gt; &#8216;猪窝窝&#8217;,<br />
&#8216;www.ooso.net&#8217; =&gt; &#8216;ooso.net&#8217;<br />
);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mimosa</title>
		<link>http://www.ooso.net/archives/303/comment-page-1#comment-8628</link>
		<dc:creator>Mimosa</dc:creator>
		<pubDate>Fri, 25 May 2007 02:29:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/303#comment-8628</guid>
		<description>受益了～多谢分享经验。</description>
		<content:encoded><![CDATA[<p>受益了～多谢分享经验。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: volcano</title>
		<link>http://www.ooso.net/archives/303/comment-page-1#comment-8625</link>
		<dc:creator>volcano</dc:creator>
		<pubDate>Fri, 25 May 2007 01:28:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/303#comment-8625</guid>
		<description>可读性跟这个不冲突

比如你可以写：

&lt;code&gt;
$replace = array(
 &#039;某人&#039; =&gt; &#039;坏人&#039;, 
 &#039;的&#039;    =&gt; &#039;di&#039;,
  &#039;栖息地&#039; =&gt; &#039;猪窝窝&#039;,
  &#039;www.ooso.net&#039; =&gt; &#039;ooso.net&#039;
);
$str = str_replace(array_keys($replace), array_values($replace), $str);
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>可读性跟这个不冲突</p>
<p>比如你可以写：</p>
<p><code><br />
$replace = array(<br />
 '某人' => '坏人',<br />
 '的'    => 'di',<br />
  '栖息地' => '猪窝窝',<br />
  'www.ooso.net' => 'ooso.net'<br />
);<br />
$str = str_replace(array_keys($replace), array_values($replace), $str);<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: piscdong</title>
		<link>http://www.ooso.net/archives/303/comment-page-1#comment-8624</link>
		<dc:creator>piscdong</dc:creator>
		<pubDate>Fri, 25 May 2007 01:13:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/303#comment-8624</guid>
		<description>关于第一条：有时候是有必要替换多次的，比如为了程序的可读性和可扩展性</description>
		<content:encoded><![CDATA[<p>关于第一条：有时候是有必要替换多次的，比如为了程序的可读性和可扩展性</p>
]]></content:encoded>
	</item>
</channel>
</rss>

