php file_exists中文路径不存在问题

php的file_exists函数使用中文路径,会显示文件不存在,即使文件已经存在了也会报这个错。

解决方法:

<?php

      $file_name='D://360极速浏览器下载//a.txt';

       $file_name=iconv('UTF-8','GB2312',$file_name);

       echo file_exists($file_name); 

?>

猜你喜欢

转载自www.cnblogs.com/ahendaxia/p/9468936.html
今日推荐