<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[沧海一粟]]></title> 
<link>http://www.dzhope.com/index.php</link> 
<description><![CDATA[Web系统架构与服务器运维,php开发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[沧海一粟]]></copyright>
<item>
<link>http://www.dzhope.com/post/251/</link>
<title><![CDATA[php中查找字符串中某个字符出现个数的函数]]></title> 
<author>jed &lt;jed521@163.com&gt;</author>
<category><![CDATA[代码编程]]></category>
<pubDate>Wed, 03 Jan 2007 08:09:14 +0000</pubDate> 
<guid>http://www.dzhope.com/post/251/</guid> 
<description>
<![CDATA[ 
	今天整理商贸程序，其中得需要计算一个字符串中某个字符出现的次数，就上网搜，好不容易找到一个函数substr_count（），<br/><div class="code"><br/>&lt;?php <br/>$text = &#039;This is a test&#039; ; <br/>echo strlen ( $text ); // 14 <br/><br/>echo substr_count ( $text , &#039;is&#039; ); // 2 <br/><br/>// the string is reduced to &#039;s is a test&#039;, so it prints 1 <br/>echo substr_count ( $text , &#039;is&#039; , 3 ); <br/><br/>// the text is reduced to &#039;s i&#039;, so it prints 0 <br/>echo substr_count ( $text , &#039;is&#039; , 3 , 3 ); <br/><br/>// generates a warning because 5+10 &gt; 14 <br/>echo substr_count ( $text , &#039;is&#039; , 5 , 10 ); <br/><br/><br/>// prints only 1, because it doesn&#039;t count overlapped subtrings <br/>$text2 = &#039;gcdgcdgcd&#039; ; <br/>echo substr_count ( $text2 , &#039;gcdgcd&#039; ); <br/>?&gt; <br/></div><br/>Tags - <a href="http://www.dzhope.com/tags/php/" rel="tag">php</a> , <a href="http://www.dzhope.com/tags/%25E5%25AD%2597%25E7%25AC%25A6%25E5%2587%25BD%25E6%2595%25B0/" rel="tag">字符函数</a>
]]>
</description>
</item><item>
<link>http://www.dzhope.com/post/251/#blogcomment2997</link>
<title><![CDATA[[评论] php中查找字符串中某个字符出现个数的函数]]></title> 
<author>台北妹妹籣 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 02 Apr 2008 03:04:25 +0000</pubDate> 
<guid>http://www.dzhope.com/post/251/#blogcomment2997</guid> 
<description>
<![CDATA[ 
	谢谢！！！
]]>
</description>
</item><item>
<link>http://www.dzhope.com/post/251/#blogcomment4908</link>
<title><![CDATA[[评论] php中查找字符串中某个字符出现个数的函数]]></title> 
<author>sad &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 03 Sep 2008 04:11:19 +0000</pubDate> 
<guid>http://www.dzhope.com/post/251/#blogcomment4908</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>