php导出excel方法: 所有语言通用
后端: //导出 if($_GPC['export']==1){ $list_export = pdo_fetchall($sql.$where); include $this->template('export'); } 前端: {php echo header('Content-type: application/vnd.ms-excel');} {php echo header('Content-Disposition: attachment; filename="二维码扫描记录表'.date('Y-m-d H:i').'导出.xls"');} <html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns=" http://www.w3.org/TR/REC-html40" > <head> <meta http-equiv=Content-Type content="text/html; charset=utf8"> <meta name=ProgId content=Excel.Sheet> <meta name=Generator content="Microsoft Excel 12"> </head>