PHP code example of ruvents / office-tools

1. Go to this page and download the library: Download ruvents/office-tools 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/ */

    

ruvents / office-tools example snippets




use Ruvents\OfficeTools\Editor\DocxEditor;

(new DocxEditor('original.docx'))
    ->replace([
        '__first_name__' => 'Ivan',
        '__last_name__' => 'Ivanov',
    ])
    ->saveTo('target.docx', \ZipArchive::OVERWRITE);