例如我的文件名是:上海“1+1”峰会的 [报告及评估].pdf
求一个解决办法;
回复内容:
例如我的文件名是:上海“1+1”峰会的 [报告及评估].pdf
求一个解决办法;
<code><?php$string = '上海“1+1”峰会的 [报告及评估].txt';$string = iconv('UTF-8','GB2<b>%本文@来源gao@!dai!ma.com搞$$代^@码!网</b><strong>搞代gaodaima码</strong>312',$string);$file = fopen($string,'r');echo fgets($file);</code>
我写了一个demo,其实中间只需要进行一次字符串转化,转化为gb2312就可以了
<code>$string = '上海“1+1”峰会的 [报告及评估].pdf';$string = iconv('UTF-8','GB2312',$string);</code>
修改(GB2312改为了GBK,好像就解决了):
<code>$str = './粤食药监办科﹝2016﹞115号 关于印发推进“互联网+食品药品监管”的实施方案的通知.txt';$str = iconv('UTF-8','GBK',$str);$file = fopen($str,'r');echo fgets($file);</code>