Standalone XLSX package
PHP XLSX Library for Reading, Writing & Large Files
Use the standalone MNB PHPExcel XLSX package when your application owns modern Excel .xlsx files and needs native reading, writing, streaming, inspection, formulas, styles, security, or bounded-memory processing.
Composer
composer require mnb/mnb-phpexcel-xlsx:^2.0- Package
mnb/mnb-phpexcel-xlsx- Entry API
Mnb\PHPExcel\Format\Xlsx- Runtime
- PHP 8.1+
- Format
- .xlsx · Excel 2007+
Choose your XLSX workflow#
01
Start with a working read and writeOpen an XLSX worksheet as associative rows, return structured data, and create a basic workbook.
Quick start →02Read XLSX dataChoose worksheets, headers, ranges, projections, formulas, dates, metadata, and normalized rows.
Reading guide →03Write XLSX reportsCreate simple exports or richer workbooks with styles, validation, charts, pivots, images, and protection.
Writing guide →04Inspect, secure, or process large filesPreview workbook structure, validate uploads, handle encryption, and choose bounded-memory large-file APIs.
Inspection & security →Use the right XLSX API#
| Task | Primary API | Choose it when |
|---|---|---|
| Read normalized rows | Xlsx::read() | You need headers, projection, ranges, chunks, validation, or structured output. |
| Read a cell or range | Xlsx::cell() / Xlsx::rangeValues() | The workbook behaves like a lookup document and you do not need a row session. |
| Inspect before reading rows | Xlsx::read(...)->inspect() / sheetNames() | You need sheet names, dimensions, warnings, or an upload preview first. |
| Write a straightforward workbook | Xlsx::write() | Associative rows and normal writer options cover the output. |
| Build a rich workbook | WorkbookData + XlsxWriter | You need explicit styles, charts, pivots, validation, images, comments, or protection definitions. |
| Process very large XLSX files | LargeXlsxReadSession | Bounded memory, progress callbacks, resume checkpoints, or database ingestion matters. |
What the standalone XLSX package covers#
Workbook data and metadata
- Sheets, headers, ranges and projected columns
- Formulas, dates and number formats
- Comments, hyperlinks, images and protection metadata
- Lightweight sheet names, dimensions and inspection
Reports and workbook features
- Rows, styles and number formats
- Validation, conditional formatting and freeze panes
- Charts, pivot definitions, images and comments
- Workbook/worksheet protection and password encryption
Production XLSX workflows
- Forward-only and bounded-memory reading
- Shared-string strategies and preflight analysis
- Progress callbacks, row errors and compatibility checks
- Standard and Agile encrypted XLSX handling
Package boundary: this guide uses Mnb\PHPExcel\Format\Xlsx from mnb/mnb-phpexcel-xlsx. Install the focused XLSX library or the monolithic mnb/mnb-phpexcel package for a project, not both.
Was this guide useful?Use GitHub issues for corrections, missing examples, or unclear behavior.
Open an issue