Replies: 3   Views: 3234
Use replacetablevariable between two specific placeholders
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 krishna shah  · 10-12-2015 - 07:57

When using a replaceTableVariable, it replaces all the variables available in any other table with the same name in word document. Can I use replaceTableVariable for only single table? Or Is it possible to replace variables between two specific placeholders?

     First Name  | Last Name
     $firstname$ | $lastname$

And I need to replace these $firstname$ and $lastname$ variables (with single or multiple values) between $startReport$ and $endReport$ only. $firstname$ or $lastname$ should not be replace if they exist in any other section within same document.

Posted by admin  · 10-12-2015 - 10:58


What version and license of phpdocx are you using?


Posted by krishna shah  · 11-12-2015 - 05:19


Currently I am using a trial version of phpdocx library, But I can opt for an Enterprice version if my needs will be fulfilled with that.

Thank you in advance. 

Posted by admin  · 11-12-2015 - 08:34


Yes, it's easy to be done using the Corporate or Enterprise licenses. After you purchase the license please write an email to contact[at] and we'll send you a sample script.