我尝试使用PHPExcel工具将csv转换为xlsx,当我运行脚本时出现错误,转换后我在excel文件中获得了中文字体: Error PHP EXECL 这是我的代码:
<?php
include 'PHPExcel/PHPExcel/IOFactory.php';
$objReader = PHPExcel_IOFactory::createReader('CSV');
// If the files uses a delimiter other than a comma (e.g. a tab), then tell the reader
$objReader->setDelimiter("\t");
// If the files uses an encoding other than UTF-8 or ASCII, then tell the reader
$objReader->setInputEncoding('UTF-16LE');
$objPHPExcel = $objReader->load('myfilebeforeconvert.csv');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('afterconvert.xls');
我的错是什么?请告诉我