//导出word开始 $doc_name = $result['company_info']['ENTNAME']."信用舆情报告.doc"; ob_start(); //打开缓冲区 header("Cache-Control: public"); Header("Content-type: application/octet-stream"); Header("Accept-Ranges: bytes"); if (strpos($_SERVER["HTTP_USER_AGENT"],'MSIE')) { $doc_name = iconv("utf-8","gb2312",$doc_name); header('Content-Disposition: attachment; filename='.$doc_name); }else if (strpos($_SERVER["HTTP_USER_AGENT"],'Firefox')) { Header('Content-Disposition: attachment; filename='.$doc_name); } else { header('Content-Disposition: attachment; filename='.$doc_name); } header("Pragma:no-cache"); header("Expires:0"); ob_end_flush();//输出全部内容到浏览器