I have a docx file, a contract template. In it, buyer data and other data are variable. The system in PHP needs to get information from the database and replace it in the docx template file. That is, keep the main structure and replace only a few words. After, save the word and make it available for download.
I have seen some libraries that do this, where you can define variables and make these substitutions. However, I do not remember the name or how to do it.
Someone who could help me? With resources that I can use and / or small examples?
Example: The document has a fixed paragraph. In this paragraph, a word will be defined variable at the time of generating the file and after customizing the template, it should be saved in docx.