fyiyy

use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\IOFactory;

$info = public_path().\'/uploads/admin/examination/test.docx\';
$phpWord = new PhpWord();
$sections =IOFactory::load($info)->getSections();

foreach($sections as $section) {

  $elements = $section->getElements();
  foreach($elements as $element) {

    echo $element->getElements()[0]->getText() . "\n";
  }
}

分类:

技术点:

相关文章: