PHP code example of it-poet / excel-keys-replacer

1. Go to this page and download the library: Download it-poet/excel-keys-replacer 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/ */

    

it-poet / excel-keys-replacer example snippets


$excel = new \ItPoet\ExcelKeysReplacer\Replacer;  
$excel->file('path/to/file/xls_keys.xls');            
$excel->data([  
    'key1' => 'some text',  
    'key2' => '12345',  
]);  
$xls = $excel->replace();  
$writer = new \PHPExcel_Writer_Excel5($xls);  
$writer->save('path/to/file/xls_replaced.xls'); 
 

$excel->keyWrapper('${', '}$');  
$excel->sheet(0);