MNB PHPExcelDeveloper Guide

Main package · PHP 8.1+ · Framework-neutral

MNB PHPExcel, the complete PHP Excel library.

Install one main package to read, write, stream, validate and import spreadsheet data. MNB PHPExcel brings XLSX, XLS, CSV, JSON, XML, ODS and database workflows together behind one consistent PHP API.

composer require mnb/mnb-phpexcel:^2.0
PHP 8.1+Typed, modern API
8 librariesInstall complete or modular
StreamingLarge-file workflows
AES-256Encrypted XLSX output

See MNB PHPExcel in real code.

Four focused examples cover the main workflows without repeating the feature list. Each tab links to a complete tutorial with expected output and error handling.

read-orders.php
<?php

require __DIR__ . '/vendor/autoload.php';

use Mnb\PHPExcel\MnbExcel;

$sheet = MnbExcel::read('orders.xlsx')
    ->sheet('Orders')
    ->withHeaderRow(1);

foreach ($sheet->rows() as $row) {
    echo $row['Order ID'] . PHP_EOL;
}

Install only the format or integration you need.

The complete mnb/mnb-phpexcel package is recommended for most applications. Individual packages keep smaller projects focused while preserving the same documented conventions.

RecommendedComplete MNB PHPExcel package

One dependency for all documented formats, database tools and application workflows.

View complete-package installation
01Excel 2007+

XLSX library

Native XLSX reading, writing, row streaming, formulas, styles, charts and AES-256 workbook security.

mnb/mnb-phpexcel-xlsx:^2.0
View XLSX documentation
02Legacy Excel

XLS library

Independent BIFF8 and OLE/CFB support for legacy Excel 97–2003 workbook reading and writing.

mnb/mnb-phpexcel-xls:^2.0
View XLS documentation
03CSV + TSV

CSV library

Streaming CSV and TSV input and output with delimiter detection, encoding conversion and injection protection.

mnb/mnb-phpexcel-csv:^2.0
View CSV documentation
04JSON + NDJSON

JSON library

Read and write JSON, JSON Lines and NDJSON, including streamed arrays and workbook-shaped payloads.

mnb/mnb-phpexcel-json:^2.0
View JSON documentation
05Secure XML

XML library

Forward-only XML processing with secure parser defaults, schema mapping and configurable output.

mnb/mnb-phpexcel-xml:^2.0
View XML documentation
06OpenDocument

ODS library

Native OpenDocument Spreadsheet reading with worksheet selection, projection, dates and formulas.

mnb/mnb-phpexcel-ods:^2.0
View ODS documentation
07PDO imports

Database library

Format-neutral PDO imports with mapping, validation, domain presets, batches and failed-row reporting.

mnb/mnb-phpexcel-database:^2.0
View Database documentation
08XLSX → PDO

Database XLSX library

Stream large XLSX worksheets directly into PDO with chunks, resumable manifests and failure output.

mnb/mnb-phpexcel-database-xlsx:^2.0
View Database XLSX documentation

One facade, specialized libraries underneath.

The complete mnb/mnb-phpexcel distribution connects the format engines, database tools and application workflows documented across this site. Use the main facade for a consistent API while each library remains independently documented and installable.

Main distributionMNB PHPExcel
FORMATSDATABASEWORKFLOWSMnbExcel

Answers before you install.

Quick guidance for PHP developers choosing a spreadsheet library, processing large XLSX files, importing workbook data or replacing legacy PHPExcel code.

What is MNB PHPExcel?

MNB PHPExcel is an MIT-licensed PHP Excel library for reading, writing, streaming, validating and importing XLSX, XLS, CSV, JSON, XML and ODS data through a modern PHP 8.1+ API.

Can it read large XLSX files without loading every row into memory?

Yes. Use forward-only row iteration, selected-column projection or chunk processing. Start with the memory-efficient XLSX reader guide.

Can I import Excel data into MySQL with PHP?

Yes. The database workflow covers header mapping, validation, previews, dry runs, batched PDO inserts, updates and failed-row reporting. See the Excel-to-MySQL use case.

Does the library support PHP 8?

The current documentation targets PHP 8.1 and later, with typed APIs and Composer installation through mnb/mnb-phpexcel.

Is MNB PHPExcel a replacement for the old PHPExcel project?

It provides modern spreadsheet workflows for PHP 8, but the APIs are not drop-in identical. Use the migration guide to map legacy patterns deliberately.

Documentation for MNB PHPExcel v2.0.6