public static function saveexcel($objphpexcel, $excelname, $output) {
$objwriter = phpexcel_iofactory::createwriter ( $objphpexcel, 'excel5' );
if (! strpos ( $_server ['http_user_agent'], 'firefox' ))
$excelname = urlencode ( $excelname );
if ($output) {
ob_end_clean ();
header ( content-type: application/force-download );
header ( content-type: application/octet-stream );
header ( content-type: application/download );
header ( content-disposition: attachment; filename= . $excelname . .xls );
header ( content-transfer-encoding: binary );
header ( expires: mon, 26 jul 1997 05:00:00 gmt );
header ( last-modified: . gmdate ( d, d m y h:i:s ) . gmt );
header ( cache-control: must-revalidate, post-check=0, pre-check=0 );
header ( pragma: no-cache );
$objwriter->save ( 'php://output' );
} else {
$objwriter->save ( excel/ . $excelname . .xls );
echo '';
}
}
摘自 lpdx111的专栏
http://www.bkjia.com/phpjc/478172.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/478172.htmltecharticlepublic static function saveexcel($objphpexcel, $excelname, $output) { $objwriter = phpexcel_iofactory::createwriter ( $objphpexcel, excel5 ); if (! strpos ( $_server [http_user_age...