有没有一个可以把UTF-8编码的.csv转换成Excel .xls文件的PHP模块?谢谢
发布于 2011-05-12 14:43:22
考虑使用诸如PHPExcel这样的库,它可以读取各种格式的电子表格(包括CSV),并将其写入Excel .xls或.xlsx文件。
include 'PHPExcel/IOFactory.php';
$inputFileType = 'CSV';
$inputFileName = 'inputFile.csv';
$outputFileType = 'Excel5';
$outputFileName = 'outputFile.xls';
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load($inputFileName);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $outputFileType);
$objWriter->save($outputFileName);发布于 2011-05-12 12:58:13
https://stackoverflow.com/questions/5973428
复制相似问题