Lucas Giordano - 2014-11-11 19:38:40
This shit doesnt works, just use this
<?php
require_once('PHPExcel.php');
class CSVToExcelConverter
{
public static function convert($csv_file, $xls_file, $delimiter=",", $csv_enc=null) {
$objReader = PHPExcel_IOFactory::createReader('CSV');
$objReader->setDelimiter($delimiter);
if($csv_enc){
$objReader->setInputEncoding($csv_enc);
}
$objPHPExcel = $objReader->load($csv_file);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save($xls_file);
}
}