Forum


Replies: 1   Views: 479
Search and replace with array
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 ordersvrc  · 20-06-2023 - 18:59

The actual goal of my function is to replace all ssn's in a document with 'xxx-xx-xxxx'; however searchAndReplace method does not allow regex.   

My workaround is to getWordContents, get the ssn's using regex there and then create an array of 'ssn' that I can search and replace.

The problem is, that It looks like right now, the searchAndReplace  method only allows you to do one string and it outputs a file so i cannot iterate over my array.  

Is there a better solution or a method I'm unaware of?