Forum


Replies: 1   Views: 3739
Phpdocx: replace variable by text
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by hasni  · 23-10-2014 - 10:37

I am having issues in saving a clients address (i am retrieving from database) in a contract word format generating it dynamically for different clients. The problem i am facing is the a client address may have some " 's " in its address or name but its getting saved on the word document as " King's Close 62 Huntly Street United Kingdom " where as the original address is " King's Close 62 Huntly Street United Kingdom " i call this $docx->replaceVariableByText($variables); function where variables represent an array which is to be populated into the word document. The apostrophes is getting encoded into its character and i can't find any solutions out. Kindly help me out.

Posted by admin  · 24-10-2014 - 09:55

Hello, Please try escaping the string using the addslashes function. Regards.