+ $worksheet->setInputEncoding('UTF-8');
+
+ for ($r = 0; $r < count($json); $r++) {
+ $row = $json[$r];
+ for ($c = 0; $c < count($row); $c++) {
+ $worksheet->write($r, $c, $row[$c]);
+ }
+
+ }
+ $workbook->close();
+
+ require_once 'File/Convert.php';
+ $fc= new File_Convert($outfile2, "application/vnd.ms-excel");
+ $fn = $fc->convert("application/vnd.ms-excel");
+ $fc->serve('attachment','excel-'.date('Y-m-d-H-i-s').'.xls'); // can fix IE Mess
+ unlink($outfile2);