This project is read-only.

PHP - replace strings in .doc file

May 4, 2016 at 4:17 AM
Edited May 4, 2016 at 4:19 AM

I am new to PHPWord and was wondering if the script can help with the following problem.

I have a folder with numerous .doc (and some .docx) files and would like to open each of them, and then replace strings such as "$$PROPERTY$$" with my previously entered $property variable. There are also replacements for $$DATE$$, $$AREA$$, $$OUTLET$$ and others.

Finally, there is also one image embedded in the word files that should be replaced with the one linked in my $logo variable. The pictures are both the same size and same location.

How would I best go about this and can WordPHP actually do this?

Thank you,