Standalone XLS package
PHP XLS Library for Reading & Writing Legacy Excel Files
Use the standalone MNB PHPExcel XLS package when your application must read or write legacy Excel 97–2003 .xls workbooks with native BIFF8 and OLE/CFB support.
Composer
composer require mnb/mnb-phpexcel-xls:^2.0- Package
mnb/mnb-phpexcel-xls- Entry API
Mnb\PHPExcel\Format\Xls- Runtime
- PHP 8.1+
- Format
- .xls · Excel 97–2003
Choose your XLS workflow#
01
Read legacy Excel workbooksOpen BIFF8 worksheets, select sheets, map headers, read formulas and dates, and iterate normalized rows.
Reading guide →02Write Excel 97–2003 filesCreate .xls outputs for systems that still require the BIFF8 format and preserve workbook structure where supported.
Writing guide →03Check format limits before choosing XLSReview the legacy row/column limits, workbook constraints, and features that are better handled by XLSX.
Limits & compatibility →04Review package capabilitiesSee exactly which native reader, writer, formula, styling, and compatibility features belong to this package.
Feature matrix →Use the right XLS API#
| Task | Primary API | Choose it when |
|---|---|---|
| Read normalized rows | Xls::read() | You want the package-local facade with headers, sheet selection, row iteration, arrays, and normalized reader options. |
| List or inspect worksheets | XlsReader::sheetNames() | You need workbook structure before choosing which worksheet to process. |
| Iterate a worksheet directly | XlsReader::iterateSheet() | You need direct native BIFF8 iteration without building a higher-level facade workflow first. |
| Write a straightforward workbook | Xls::write() | Associative rows and normal writer options are enough for a legacy .xls export. |
| Write from workbook data | WorkbookData + XlsWriter | You already have an explicit workbook model and need the native XLS writer directly. |
What the standalone XLS package covers#
Native BIFF8 workbook data
- OLE/CFB compound-file containers
- Worksheet selection and normalized rows
- Shared strings, dates, formats and cached formula values
- Sheet names, ranges and binary-parser safeguards
Legacy Excel output
- Excel 97–2003 .xls workbooks
- Rows, cells, formulas, merges and dimensions
- Workbook metadata and supported pane/layout settings
- Package-local facade or direct native writer APIs
Use XLS deliberately
- Best for integrations that explicitly require .xls
- Native implementation without PhpSpreadsheet
- Legacy BIFF8 format limits still apply
- Prefer XLSX for modern workbook features and larger sheets
Package boundary: this guide uses Mnb\PHPExcel\Format\Xls from mnb/mnb-phpexcel-xls. Install the focused XLS 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