PHP code example of plumphp / plum-excel

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

    

plumphp / plum-excel example snippets


use Plum\PlumExcel\ExcelWriter;

$writer = new ExcelWriter(__DIR__.'/example.xlsx');
$writer->autoDetectHeader();

$writer->setHeader(['Country Name', 'ISO 3166-1-alpha-2 code']);

$writer = new ExcelWriter(__DIR__.'/example.xlsx', $excel, 'Excel2007', $writer);

use Plum\PlumExcel\ExcelReader;

$reader = new ExcelReader(__DIR__.'/example.xlsx');

use Plum\PlumExcel\ExcelReader;

$excel = PHPExcel_IOFactory::load(__DIR__.'/example.xlsx');
$reader = new ExcelReader($excel);

use Plum\Plum\Converter\HeaderConverter;
use Plum\Plum\Filter\SkipFirstFilter;
use Plum\PlumExcel\ExcelReader;

$workflow->addConverter(new HeaderConverter());
$workflow->addFilter(new SkipFirstFilter(1));
$workflow->process(new ExcelReader($filename));