<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[PHP的mb_substr和mb_strcut的区别]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Tue, 28 Jul 2009 04:04:03 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	php的mbstring扩展模块提供了多字节字符的处理能力，平常最常用的就是用mbstring来切分多字节的中文字符，这样可以避免出现半个字符的情况，由于是php的扩展，它的性能也要比一些自定义的多字节切分函数要好上一些。<br/><br/>mbstring extension提供了几个功能类似的函数，mb_substr和mb_strcut，看看手册上对它们的解释。<br/><br/>mb_substr<br/>mb_substr() returns the portion of str specified by the start and length parameters.<br/><br/>mb_substr() performs multi-byte safe substr() operation based on number of characters. Position is counted from the beginning of str. First character's position is 0. Second character position is 1, and so on.<br/><br/>mb_strcut<br/>mb_strcut() returns the portion of str specified by the start and length parameters.<br/><br/>mb_strcut() performs equivalent operation as mb_substr() with different method. If start position is multi-byte character's second byte or larger, it starts from first byte of multi-byte character.<br/><br/>It subtracts string from str that is shorter than length AND character that is not part of multi-byte string or not being middle of shift sequence.<br/><br/>举个例子来说,有一段文字, 分别用mb_substr和mb_strcut来做切分:<br/><br/>PLAIN TEXT<br/>CODE:<br/><?php<br/>$str = '我是一串比较长的中文-www.webjx.com';<br/><br/>echo "mb_substr:" . mb_substr($str, 0, 6, 'utf-8');<br/><br/>echo "<br/>";<br/><br/>echo "mb_strcut:" . mb_strcut($str, 0, 6, 'utf-8');<br/>?><br/>输出结果如下：<br/><br/>mb_substr:我是一串比较<br/>mb_strcut:我是
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] PHP的mb_substr和mb_strcut的区别]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>