PHP code example of vishwayon / phpstep

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

    

vishwayon / phpstep example snippets




$model = new \stdClass();
$model->message = 'Hello World!';
$model->stats = [
    ['country' => 'India', 'population' => 1300]
    ['country' => 'USA', 'population' => 330,
    ['country' => 'Russia', 'population' => 145
];

$reader = PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx');
$ss = $reader->load("sample.xlsx");
$worksheet = $ss->getActiveSheet();

$re = new PhpStep\RenderWorksheet();
$re->applyData($worksheet, $model);

$writer = PhpOffice\PhpSpreadsheet\IOFactory::createWriter($ss, 'Xlsx');
$writer->save('sampleResult.xlsx');