如何将PHP网页导出为Word文件

                #将本地临时文件渲染数据
                $file = $protocol_info['src'] . '/' . 'baiqishi';
                $content = $this->fetch($file . '.html');//替换成模板渲染
                $wordFile = $protocol_info['src'] . '/files/' . $run_id . '.html';
                $fh = fopen($wordFile, "w+");
                fwrite($fh, $content);
                ob_clean();
                fclose($fh);//关闭句柄很重要

 

 

posted @ 2018-02-09 16:44  王芬老师  阅读(458)  评论(0编辑  收藏  举报