mnb / mnb-phpexcel-csv
CSV reader/writer module for MNB PHPExcel.
v2.0.0
2026-07-29 08:56 UTC
Requires
- php: >=8.1
- mnb/mnb-phpexcel-core: ^2.0
Conflicts
This package is auto-updated.
Last update: 2026-08-03 13:02:01 UTC
README
Independent CSV reader/writer module. Requires only mnb/mnb-phpexcel-core.
composer require mnb/mnb-phpexcel-csv:^2.0
use Mnb\PHPExcel\Format\Csv; $rows = Csv::read('customers.csv')->withHeaderRow()->toArray(); Csv::write($rows, 'customers-export.csv', [ 'with_header' => true, 'dialect' => 'excel', ]);
Supports streaming reads, dialect detection/configuration, encoding conversion, BOM handling, projection, and formula-injection policies.
Unified metadata
$quick = Csv::metaInfo('customers.csv', [ 'profile' => 'quick', ]); $full = Csv::read('customers.csv')->metaInfo([ 'profile' => 'full', 'max_items' => 1000, ]);
The CSV collector uses the shared metadata schema and reports:
- file size, filesystem dates, MIME type, and optional SHA-256;
- detected encoding, BOM, delimiter, enclosure, escape character, and line endings;
- CSV/TSV variant and mixed line-ending detection;
- complete or sampled row/cell statistics;
- minimum, maximum, and modal column counts;
- ragged and blank rows;
- header-detection confidence;
- formula-like cells that may create CSV-injection risk;
- a synthetic single worksheet for cross-format API consistency.
Workbook-only sections such as document properties, macros, charts, pivots, and protection return not_applicable. CSV has no standard embedded metadata property store, so updateMetaInfo() is intentionally not provided for CSV files.