I know there are librarys such as PHPWord or PHPDocx, but PHPWord is inefficient and can lose variables and PHPDocx is a paid library so I can’t use that. Is there some type of field in word which remains constant and is easily legible which I can use for my replacement fields in my php script?
I’ve tried str_replace with tags like ${TAG1} but sometimes these characters get seperated by word tags and therefore the script doesn’t find them.. Any help?
I know there are librarys such as PHPWord or PHPDocx, but PHPWord is inefficient
Share
You could use bookmarks. If you create a bookmark with the name “title” the document.xml will contain these tags:
How to modify xml file using PHP