Exemple #1
0
 public static function download_excel($filename, $head_array, $datalist)
 {
     $output = "<HTML>";
     $output .= "<HEAD>";
     $output .= "<META http-equiv=Content-Type content=\"text/html; charset=utf-8\">";
     $output .= "</HEAD>";
     $output .= "<BODY>";
     $output .= Excel::arr_tbl_excel($head_array, $datalist);
     $output .= "</BODY>";
     $output .= "</HTML>";
     header("Content-type:application/msexcel");
     header("Content-disposition: attachment; filename={$filename}.xls");
     header("Cache-control: private");
     header("Pragma: private");
     print $output;
 }