Home  >  Article  >  php教程  >  phpExcel类从mysql中将数据导出到xls乱码

phpExcel类从mysql中将数据导出到xls乱码

WBOY
WBOYOriginal
2016-06-13 10:07:261345browse

php教程Excel类从mysql教程中将数据导出到xls乱码

$objPHPExcel->setActiveSheetIndex(0)
  ->setCellValue('A1', iconv('gbk', 'utf-8', '中文Hello'))
  ->setCellValue('B2', 'world!')
  ->setCellValue('C1', 'Hello')
  ->setCellValue('D2', 'world!');

//用php 用自带转码函数iconv转换一下就OK了。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn