PHPackages                             laacz/xls-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. laacz/xls-parser

AbandonedArchivedLibrary

laacz/xls-parser
================

Library to parse XLS files

0.3(7y ago)947.9k↓41.3%2MITPHPPHP &gt;=5.4

Since Jan 27Pushed 4y ago4 watchersCompare

[ Source](https://github.com/laacz/xls-reader)[ Packagist](https://packagist.org/packages/laacz/xls-parser)[ Docs](https://github.com/laacz/xls-reader)[ RSS](/packages/laacz-xls-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (4)Used By (0)

*XLSParser* is reasonably fast PHP library intended to parse Microsoft Excel legacy binary XLS formats. It was written because all PHP implementations where too slow. Code is more or less direct port of python's excellent [xlrd package](https://pypi.python.org/pypi/xlrd). Library is very early alpha. I made it a long time ago.

Feedback
========

[](#feedback)

Issues and pull requests are accepted.

Requirements
============

[](#requirements)

- PHP 5.4.0 or newer.
- [Multibyte string extension](http://php.net/mbstring) (*mbstring*) to handle UTF-16LE encoding, used in newer Excel files.
- Little endian system because of PHP's unpack/pack. If you're not on *Sparc*, you should be covered.

Install
=======

[](#install)

Via command line: `composer require laacz/xls-parser`.

Tests
=====

[](#tests)

Install dependencies with `composer install --dev`, then run tests with `vendor/bin/phpunit`.

Usage
=====

[](#usage)

KISS. Provide filename and it gets loaded or parsed.

```
$book = new laacz\XLSParser\Book(file_get_contents('workbook.xls'));
```

Accessing sheets
================

[](#accessing-sheets)

Sheets can be accessed via their numeric index or name. Since `Sheet` object implements *ArrayAccess* and *IteratorAggregate*, you can do that too.

```
$sheet = $book[0];
$sheet = $book['Page1'];
$sheet = $book['Vājprāts'];
```

Accessing cells
===============

[](#accessing-cells)

Cells also can be accessed as with sheets. Index starts from zero.

```
$row = $sheet[0];
$cell = $sheet[$sheet->nrows - 1][1];
```

To get value of a cell, cast it to string (or use it in such context) or get `value` attribute:

```
$val1 = $cell->value;
$val2 = (string)$cell;
```

Or, if you wish...

```
$val1 = $book[0][0][0]->value;
```

Formatting
==========

[](#formatting)

By now formatting can be accessed raw. In short - sheet contains mapping array `rich_text_runlist_map[][]`, which has arrays with two elements - position and font reference. First is position where style is being applied from, second is number which refers to book's `font_list[]`, which on its part contains format description.

Excel dates
===========

[](#excel-dates)

Library does its best to parse dates found within cells. It returns string in common date format: 'yyyy-mm-dd hh:mi:ss'. For example: 2014-12-31 12:59:59.

Wishlist
========

[](#wishlist)

- Memory efficiency does not exist in context of this library.
- Performance might be better.
- Abstract formatting.
- Add helper methods for common tasks - returning columns, ranges, etc.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~770 days

Total

3

Last Release

2588d ago

PHP version history (2 changes)0.1PHP &gt;=5.5

0.2PHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/d8e7946c7a86e63a51bc95b7338eac05cbdf3f533bf19e8c7ae2c06f13d6cba1?d=identicon)[laacz](/maintainers/laacz)

---

Top Contributors

[![laacz](https://avatars.githubusercontent.com/u/181486?v=4)](https://github.com/laacz "laacz (19 commits)")[![jadeops](https://avatars.githubusercontent.com/u/85561678?v=4)](https://github.com/jadeops "jadeops (2 commits)")

---

Tags

xls

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laacz-xls-parser/health.svg)

```
[![Health](https://phpackages.com/badges/laacz-xls-parser/health.svg)](https://phpackages.com/packages/laacz-xls-parser)
```

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

13.9k293.5M1.3k](/packages/phpoffice-phpspreadsheet)[rap2hpoutre/fast-excel

Fast Excel import/export for Laravel

2.3k24.9M47](/packages/rap2hpoutre-fast-excel)[mk-j/php_xlsxwriter

PHP Library to write XLSX files

1.9k8.1M27](/packages/mk-j-php-xlsxwriter)[sonata-project/exporter

Lightweight Exporter library

44920.9M35](/packages/sonata-project-exporter)[liuggio/excelbundle

This is a Symfony2 Bundle helps you to read and write Excel files (including pdf, xlsx, odt), thanks to the PHPExcel library

3776.4M10](/packages/liuggio-excelbundle)[nuovo/spreadsheet-reader

Spreadsheet reader library for Excel, OpenOffice and structured text files

669863.2k8](/packages/nuovo-spreadsheet-reader)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
