<?php
/*
 本代码由 口号帮 创建
 创建时间 2019-05-08 16:22:09
 技术支持 口号帮 
 严禁反编译、逆向等任何形式的侵权行为，违者将追究法律责任
*/

namespace App\Traits;use PhpOffice\PhpWord\Reader\Word2007;trait ReadWord{public function getWordContent($path){if($path)goto P2gBodyx2;goto P2gNextx2;P2gBodyx2:$P2g0=new Word2007();$phpWord=$P2g0;$source=$phpWord->load($path);$sections=$source->getSections()[0];$content='';foreach($sections->getElements()as $item){$P2g0=get_class($item)!=='PhpOffice\PhpWord\Element\TextBreak';if($P2g0)goto P2gBodyx4;goto P2gNextx4;P2gBodyx4:$element=$item->getElements();foreach($element as $e){$text='';$P2g0=get_class($e)==='PhpOffice\PhpWord\Element\Text';if($P2g0)goto P2gBodyx6;goto P2gNextx6;P2gBodyx6:$P2g0='<p>' . $e->getText();$P2g1=$P2g0 . " 

</p> ";$text=$text.$P2g1;goto P2gx5;P2gNextx6:$P2g0=get_class($e)==='PhpOffice\PhpWord\Section\TextBreak';if($P2g0)goto P2gBodyx7;goto P2gNextx7;P2gBodyx7:$text=$text." 

 ";goto P2gx5;P2gNextx7:$P2g0=get_class($e)==='PhpOffice\PhpWord\Element\Image';if($P2g0)goto P2gBodyx8;goto P2gNextx8;P2gBodyx8:$string=$e->getImageStringData();$P2g0="

&nbsp; " . '<p><img src="';$P2g1=$P2g0 . $string;$P2g2=$P2g1 . '" style = "height:400px;"> </p>';$text=$text.$P2g2;goto P2gx5;P2gNextx8:P2gx5:$content=$content.$text;}goto P2gx3;P2gNextx4:P2gx3:}return $content;goto P2gx1;P2gNextx2:return '';P2gx1:}}
?>