Skip to content
MNB PHPExcelDeveloper Guide
AI

Samples

Download Sample Excel Workbooks

Use small, reproducible XLSX fixtures for reading, writing, formulas, multiple sheets, large-file streaming, and invalid-import examples.

Level
All levels
Reading time
5 min
Package
mnb/mnb-phpexcel or mnb/mnb-phpexcel-xlsx
Updated
Downloadable fixturesXLSXFull packageIndividual XLSX
Available sincev2.0.5Last API changev2.0.5Version guide

Choose a workbook#

customers.xlsx

Customers

First read, headers, booleans, dates, arrays, and columns.

Sheets
Customers
Size
4 data rows
Download
multiple-sheets.xlsx

Multiple worksheets

Sheet discovery, active-sheet helpers, named selection, and worksheet fallback.

Sheets
Orders, Customers, Summary
Size
3 worksheets
Download
sales-report.xlsx

Sales report

Dates, formulas, summary sheets, numeric values, and report inspection.

Sheets
Sales, Summary
Size
4 orders
Download
formulas-and-styles.xlsx

Formulas and styles

Formula cells, cached values, merged headings, number formats, and styles.

Sheets
Invoice
Size
4 line items
Download
invalid-import.xlsx

Invalid product import

Missing values, negative prices, invalid quantities, bad email, duplicate SKU, and unknown status.

Sheets
Products
Size
7 source rows
Download
large-orders.xlsx

Large-order fixture

Streaming, chunking, progress, limits, projection, and memory measurements.

Sheets
Orders
Size
500 data rows
Download

Copy a fixture into your project#

Project structure

Keep documentation fixtures in a predictable local path.

Copy only the workbook you need into a test or development fixture directory so examples remain easy to reproduce.

Project layout
my-project/
├── vendor/
├── examples/
│   └── read-customers.php
└── storage/
    └── samples/
        └── customers.xlsx
First read

Point the example at the local fixture.

Use the known worksheet and header row first. Once that succeeds, move the same workflow to application-specific input.

examples/read-customers.php
<?php

declare(strict_types=1);

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

use Mnb\PHPExcel\MnbExcel;

$path = __DIR__ . '/../storage/samples/customers.xlsx';

$rows = MnbExcel::read($path)
    ->sheet('Customers')
    ->withHeaderRow(1)
    ->toArray();

print_r($rows);

Use fixtures as tests, not production templates#

Fixture boundary

Known input, known expectation.

These files are intentionally small and deterministic. Use them to confirm installation and documented behavior. Production uploads still require file-size, package, worksheet, header, row, and business-rule validation.

Integrity

Checksums for every fixture are published separately so you can verify that the downloaded workbook is unchanged.

sample-workbook-checksums.txt