我正在尝试在 .docx 文档中进行替换public function replace($seach, $replace){ $file = base_path() . '/public/templates/test.docx'; $phpword = new \PhpOffice\PhpWord\TemplateProcessor($file); $phpword->setValue('%name%', 'Santosh'); $phpword->setValue('{lastname}', 'Achari'); $phpword->setValue('{name}', 'Achari'); $phpword->setValue('{officeAddress}', 'Yahoo'); $phpword->saveAs('edited.docx');}此代码替换 in { },但不替换 for%%
- 1 回答
- 0 关注
- 205 浏览
添加回答
举报
0/150
提交
取消