This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.
This package is abandoned and no longer maintained. No replacement package was suggested.

A simple lib to import from or export into csv/xlxs/xml/json etc

2.0.1 2015-09-21 08:51 UTC

This package is not auto-updated.

Last update: 2020-01-28 12:01:52 UTC


#Excel-Wroker V2.0

a simple library to work with excels based on PHPExcel.


  • muti-workesheets, possible:
$worker->setSelectedSheets(['Sheet1', 'Sheet2'])->load('filename')->get();
  • specify columns, possible:
$worker->load('filename', true)->get(['col1', 'col2']);
$worker->load('filename')->get([0, 1, 2]);
  • limit start and end row, possible:
//skip the first 5 rows.
//only fetch 6 rows
//skip the first 7 rows and fetch the following 8 rows
$reader->limit(7, 8)->get();

$reader->limit(-1, 8) // no skip
$reader->limit(7, -1) // no take


require this package in your composer.json and update composer. It will also download PHPExcel for you.



Before usage you should include vendor/autoload.php into your file.

use ExcelWorker\ExcelWorker;
$worker = new ExcelWorker();

$rowNum = 2;
$writer = $worker->create('file'); //create() will return a Writer instance
$writer->writerRow(['a', 'b', 'c'], $rowNum);
$writer->writeColumn(['a', 'b', 'c'], $col); //both $col = 50 or $col = 'AX' could be accpeted.
$writer->save('xlsx');  //you may use ->save('xlsx', 'path') to specify the storage path.

//The second parameter is a bool value to tell whether header exists(probably the first row), default is false.
$worker->load('./path/filename.xlsx', true)->get();

//The load() method returns a Reader instance, so you could use as:
$reader = $worker->load('filename.xlsx');