vakata/spreadsheet

Simple spreadsheet reader/writer supporting XLS (read-only), XLSX and CSV files

2.2.0 2024-11-08 12:38 UTC

This package is auto-updated.

Last update: 2024-11-08 15:42:06 UTC


README

Latest Version on Packagist Software License

Simple spreadsheet reader/writer supporting XLS (read-only), XLSX, XML and CSV files. The classes try not to load all the data at once so that fairly large files are supported using iterators.

Install

Via Composer

$ composer require vakata/spreadsheet

Usage

// you can also write to browser or to stream (additional options are available for each format)
foreach (\vakata\spreadsheet\Writer::toFile('test.xlsx')->fromArray([
    [1,"asdf","2022-02-10"],
    [2,"test","2010-11-10"]
]);
// you can also read from stream
foreach (\vakata\spreadsheet\Reader::fromFile('test.xlsx') as $k => $row) {
    var_dump($row);
}
// or
var_dump(\vakata\spreadsheet\Reader::fromFile('test.xlsx')->toArray());

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email github@vakata.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.