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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. laacz/xls-parser

AbandonedArchivedLibrary[Parsing &amp; Serialization](/categories/parsing)

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

Library to parse XLS files

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

Since Jan 27Pushed 4y ago1 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 yesterday

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

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community11

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

2634d 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

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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