I need to replace content in some word documents based on User input. I am trying to read a template file (e.g. \"template.docx\"), and replace First name {fname}, Address {
If you find simple solution you can use this library
Example: This code will replace $search to $replace in $pathToDocx file
$docx = new IRebega\DocxReplacer($pathToDocx); $docx->replaceText($search, $replace);