PHP code example of snicholson / docxtemplates

1. Go to this page and download the library: Download snicholson/docxtemplates library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

snicholson / docxtemplates example snippets

 php
$ruleCollection = new RuleCollection();
$ruleTarget = '/ARegularExpression/';
$ruleData = function($match){
    //I can perform logic on the $match value in here
    return substr($match,0,3);
};o
$ruleCollection->addRegexpRule($ruleTarget,$ruleData);