<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.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://www.jackxiang.com/post//</link>
<title><![CDATA[[实践Ok]PHP里的basename函数不支持中文名的解决]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Php/Js/Shell/Go]]></category>
<pubDate>Tue, 25 Feb 2014 10:40:06 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	今天用到basename 函数获取文件名称时，发现如果是中文的文件名返回只有后缀的空文件名（如：.pdf）<br/>&nbsp;&nbsp;&nbsp;&nbsp;string basename ( string path [, string suffix] )<br/>&nbsp;&nbsp;&nbsp;&nbsp;说明<br/>&nbsp;&nbsp;&nbsp;&nbsp;给出一个包含有指向一个文件的全路径的字符串，本函数返回基本的文件名。如果文件名是以 suffix 结束的，那这一部分也会被去掉。<br/><br/>方法一：按照网站上找到说法是此函数依赖于区域设置，如果是多字节名称返回为空可以通过setlocale函数如下设置<br/><br/><textarea name="code" class="php" rows="15" cols="100">
&lt;?php
 setlocale(LC_ALL, &#039;zh_CN.GBK&#039;);
// or any other locale that can handle multibyte characters.
?&gt;
</textarea><br/><br/>最好是修改服务器的区域设置来整体解决！<br/><br/><br/>来自：http://www.vtcrm.cn/2011/01/27/vtigercrm%EF%BC%9Alinux%E4%B8%8B%E9%9D%A2phpbasename%E4%B8%8D%E6%94%AF%E6%8C%81%E4%B8%AD%E6%96%87%E7%9A%84%E8%A7%A3%E5%86%B3/<br/><br/><br/>方法二：php自带的basename函数不支持中文，下面这个方法是最简单的实现。<br/><textarea name="code" class="php" rows="15" cols="100">
&nbsp;&nbsp;&nbsp;&nbsp;function get_basename($filename)&#123;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return preg_replace(&#039;/^.+[&#92;&#92;&#92;&#92;&#92;&#92;/]/&#039;, &#039;&#039;, $filename);&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp; &#125; 
</textarea><br/><br/>http://www.thinkphp.cn/code/75.html
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践Ok]PHP里的basename函数不支持中文名的解决]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>