fps2tao

phpexcel对于中文的文件名无法读取(我本地环境都是utf-8的编码)

是不是win系统识别都是gbk ?(需要把utf-8的字符串改为gbk)

$file = "C:\\Users\\Administrator\\Desktop\\中文.xls";
$file  = iconv(\'utf-8\', \'gb2312\', $file);

$objPHPExcel = \PHPExcel_IOFactory::load($file);
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
var_dump($sheetData);

我这样可以正常输出...

我看有些把字符编码反过来如:

$str  = iconv(\'gb2312\', \'utf-8\', $str);

 

这个可能要看你当前的系统环境了..

 

 

 

参考:https://www.cnblogs.com/yelp/p/3521075.html

 

分类:

技术点:

相关文章:

  • 2022-02-10
  • 2021-09-02
  • 2022-12-23
  • 2021-05-09
  • 2021-11-04
  • 2021-08-06
  • 2021-08-01
猜你喜欢
  • 2021-07-12
  • 2021-06-18
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案