<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>https://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>https://jackxiang.com/post//</link>
<title><![CDATA[arsort编码问题探秘]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Mon, 27 Apr 2009 06:19:44 +0000</pubDate> 
<guid>https://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	arsort.php<br/><div class="code">&lt;?php<br/>$str = array(1548940117=&gt;&#039;1183888&#039;,1377417885=&gt;&#039;879126&#039;);<br/>print_r($str);<br/>arsort($str);<br/>print_r($str);<br/><br/>?&gt;</div><br/>result:<br/><div class="code">0&gt; php arsort.php <br/>Array<br/>(<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#91;1548940117&#93; =&gt; 1183888<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#91;1377417885&#93; =&gt; 879126<br/>)<br/>Array<br/>(<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#91;1548940117&#93; =&gt; 1183888<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#91;1377417885&#93; =&gt; 879126<br/>)</div><br/>这个结论是正确的结果，但是假如我们的文件编码是gbk编码，而我们的输出键值是utf-8的编码，如：'1183888'&nbsp;&nbsp;'879126'是utf-8的字符串时候，那就会出现通过arsort排序出现错误的情况，于是我们只好这样：<br/><div class="code">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($userscoreinfo as $key =&gt;$values)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $userscoreinfo&#91;$key&#93; = (int)$values;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#125;<br/></div><br/>强制转为int类型即可！！！
]]>
</description>
</item><item>
<link>https://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] arsort编码问题探秘]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>