Skip to content
MNB PHPExcelDeveloper Guide
AI
Standalone CSV + TSV package

PHP CSV & TSV Library for Streaming, Encoding & Safe Exports

Use the standalone MNB PHPExcel CSV package for low-memory CSV and TSV pipelines that need delimiter detection, encoding conversion, column projection, strict input limits, or spreadsheet-safe exports.

Composer
composer require mnb/mnb-phpexcel-csv:^2.0
Package
mnb/mnb-phpexcel-csv
Entry API
Mnb\PHPExcel\Format\Csv
Runtime
PHP 8.1+
Format
.csv / .tsv · delimited text

Choose your CSV workflow#

Use the right CSV API#

TaskPrimary APIChoose it when
Read normalized rowsCsv::read()You need headers, projection, validation, delimiter/encoding options, or forward-only row iteration.
Write delimited outputCsv::write()You need CSV or TSV output with explicit dialect, encoding, header, and injection policies.
Detect a delimiterCsvDialect::detectDelimiter()The source delimiter is unknown and should be inferred from a representative sample.
Detect source encodingEncodingDetector::detectFile()Uploads may arrive in UTF-8, Windows-1252, ISO-8859 variants, or another supported encoding.

What the standalone CSV package covers#

Read

Low-memory delimited input

  • CSV and TSV streaming row iteration
  • Header normalization and column projection
  • Delimiter and encoding detection
  • Row, column and file-size limits for uploads
Write

Controlled text exports

  • Excel, tab, semicolon, pipe and custom dialects
  • UTF-8 and configurable target encodings
  • Headers, quoting and line-ending controls
  • CSV formula-injection escape policies
Model

One logical sheet by design

  • Delimited files expose a single logical sheet
  • Fields remain text until your application converts them
  • No workbook styles, formulas or embedded media model
  • Choose XLSX when workbook presentation matters

Package boundary: this guide uses Mnb\PHPExcel\Format\Csv from mnb/mnb-phpexcel-csv. Install the focused CSV library or the monolithic mnb/mnb-phpexcel package for a project, not both.