php file_get_contents函数无法解析中文名文件问题

这个是在window7平台下做的测试.不能解析中文目录,并报错.

解决方案如下.

$filePath = iconv("UTF-8","GB2312",'G:\小明.txt') ;

$str =file_get_contents($filePath);

这个要和操作系统的编码一致才行.

原文地址:https://www.cnblogs.com/sheapchen/p/2986179.html