php word转html(可能样式会有问题 还没有空细究)

//安装拓展类 composer require phpoffice/phpword
require 'vendor/autoload.php';
$phpWord = \PhpOffice\PhpWord\IOFactory::load('./test.docx');
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, "HTML");
$xmlWriter ->save('./test.html');

 

posted @ 2021-02-24 10:54  花兮  阅读(414)  评论(0编辑  收藏  举报