小bug修复

This commit is contained in:
wangjinlei
2025-10-22 13:33:38 +08:00
parent bb308bea6f
commit 1de6125d4d
5 changed files with 36 additions and 2 deletions

View File

@@ -43,6 +43,20 @@ function readExcel($file){
return $dataset;
}
function readDocx($file){
$phpWord = IOFactory::load($file);
$frag = [];
foreach ($phpWord->getSections() as $section) {
foreach ($section->getElements() as $element) {
if (method_exists($element, 'getText')) {
// echo $element->getText() . "\n";
$frag[] = $element->getText();
}
}
}
return $frag;
}
/**
* @function sendEmail
* @intro 发送邮件(带附件)