PHPackages                             shuchkin/simplexls - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. shuchkin/simplexls

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

shuchkin/simplexls
==================

Parse and retrieve data from old format Excel XLS files. MS Excel 97 workbooks PHP reader.

1.0.0(1y ago)212588.3k↓17.3%82[6 issues](https://github.com/shuchkin/simplexls/issues)2MITPHPPHP &gt;=5.5

Since Feb 19Pushed 1y ago8 watchersCompare

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

READMEChangelogDependenciesVersions (20)Used By (2)

SimpleXLS
=========

[](#simplexls)

[![](https://camo.githubusercontent.com/854cd9307a90462938c945044a3f5cb297c0d61992369d51a02170215ec721ce/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73687563686b696e2f73696d706c65786c73)](https://packagist.org/packages/shuchkin/simplexls)

Parse and retrieve data from old Excel .XLS files. MS Excel 97-2003 workbooks PHP reader. PHP BIFF reader. No additional extensions needed (internal olereader).
Modern .XLSX php reader [here](https://github.com/shuchkin/simplexlsx).

*Hey, bro, please ★ the package for my motivation :) and [donate](https://opencollective.com/simplexlsx) for more motivation!*

[**Sergey Shuchkin**](https://www.patreon.com/shuchkin)  2016-2025

Basic Usage
-----------

[](#basic-usage)

```
if ( $xls = SimpleXLS::parseFile('book.xls') ) {
	print_r( $xls->rows() );
	// echo $xls->toHTML();
} else {
	echo SimpleXLS::parseError();
}
```

```
Array
(
    [0] => Array
        (
            [0] => ISBN
            [1] => title
            [2] => author
            [3] => publisher
            [4] => ctry
        )

    [1] => Array
        (
            [0] => 618260307
            [1] => The Hobbit
            [2] => J. R. R. Tolkien
            [3] => Houghton Mifflin
            [4] => USA
        )

)

```

Installation
------------

[](#installation)

```
composer require shuchkin/simplexls

```

or download class [here](https://github.com/shuchkin/simplexls/blob/master/src/SimpleXLS.php)

PHP 5.5-8.4

Basic methods
-------------

[](#basic-methods)

```
// open
SimpleXLS::parse( $filename, $is_data = false, $debug = false ): SimpleXLS (or false)
SimpleXLS::parseFile( $filename, $debug = false ): SimpleXLS (or false)
SimpleXLS::parseData( $data, $debug = false ): SimpleXLS (or false)
SimpleXLS:parseError(): string
// simple
$xls->rows($worksheetIndex = 0, $limit = 0): array
$xls->readRows($worksheetIndex = 0, $limit = 0): Generator - helps read huge xlsx
$xls->toHTML($worksheetIndex = 0, $limit = 0): string
// extended
$xls->rowsEx($worksheetIndex = 0, $limit = 0): array, values + meta
// meta
$xls->sheetNames():array
$xls->sheetName($worksheetIndex):string
```

Examples
--------

[](#examples)

### XLS to html table

[](#xls-to-html-table)

```
echo SimpleXLS::parse('book.xls')->toHTML();
```

or

```
if ( $xls = SimpleXLS::parse('book.xls') ) {
	echo '';
	foreach( $xls->rows() as $r ) {
		echo ''.implode('', $r ).'';
	}
	echo '';
} else {
	echo SimpleXLS::parseError();
}
```

### Sheet names

[](#sheet-names)

```
if ( $xls = SimpleXLS::parseFile('book.xls') ) {
  print_r( $xls->sheetNames() );
  print_r( $xls->sheetName( $xls->activeSheet ) );
}
```

```
Array
(
    [0] => Sheet 1
    [1] => Sheet 2
    [2] => Sheet 3
)
Sheet 2

```

### Sheets info

[](#sheets-info)

```
if ( $xls = SimpleXLS::parseFile('book.xls') ) {
  print_r( $xls->boundsheets );
}
```

```
Array
(
    [0] => Array
        (
            [name] => Sheet 1
            [offset] => 15870
            [hidden] =>
            [active] =>
        )

    [1] => Array
        (
            [name] => Sheet 2
            [offset] => 16308
            [hidden] => 1
            [active] => 1
        )

    [2] => Array
        (
            [name] => Sheet 3
            [offset] => 16746
            [hidden] =>
            [active] =>
        )
)

```

### Classic OOP style

[](#classic-oop-style)

```
$xls = new SimpleXLS('books.xls');
if ($xls->success()) {
	print_r( $xls->rows() );
} else {
	echo 'xls error: '.$xls->error();
}
```

Debug
-----

[](#debug)

```
ini_set('error_reporting', E_ALL );
ini_set('display_errors', 1 );

//header('Content-Type: text/html; charset=utf-8');

$xls = SimpleXLSX::parse('books.xls', false, true );
print_r( $xls->rows() );
print_r( $xls->sheets );
```

History
-------

[](#history)

1.0.0 (2025-03-04) 7 years, 400k downloads, we need release
0.11.1 (2025-02-14) PHP 5.5-8.4 support, fixed datetime cells thx [tomu4](https://github.com/tomu4)
0.10.5 (2024-09-17) readRows() returns Generator, thx [livingroot](https://github.com/livingroot)
0.10.4 (2023-11-13) more compatible with PHP 8.1
0.10.3 (2022-10-04) namespaced examples
0.10.2 (2022-09-01) fixed percent values
0.10.1 (2022-04-04) PHP 7.1+, PHP 8.0+
0.9.15 (2021-12-01)
 added `$xls->sheetNames()`, `\$xls->sheetName( $index )`, `$xls->activeSheet`
 added `$limit` in `$xls->rows( $sheetIndex, $limit = 0 )`
 more examples in README
0.9.14 (2021-11-04) Detect datetime format
0.9.13 (2021-09-21) Fixed éàù... in sheet names, added flag *hidden* in $xls-&gt;boundsheets info
0.9.12 (2021-09-20) Fixed éàù...
0.9.11 (2021-09-02) Added *Rows with header values as keys* example
0.9.10 (2021-05-19) SimpleXLSX to SimpleXLS in example
0.9.9 (2021-03-04) Added `$xls->toHTML()`
0.9.8 (2021-03-04) Fixed skipping first row &amp; col, fixed datetime format in unicode 0.9.7 (2021-02-26) Added `::parseFile()`, `::parseData()`
0.9.6 (2020-12-01) Fixed README
0.9.5 (2020-01-16) Fixed negative number values and datetime values
0.9.4 (2019-03-14) Added git Tag for prevent composer warning
0.9.3 (2019-02-19) Fixed datetime detection
0.9.2 (2018-11-15) GitHub release, composer

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance43

Moderate activity, may be stable

Popularity57

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 89.4% 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 ~122 days

Recently: every ~220 days

Total

19

Last Release

441d ago

Major Versions

0.11.1 → 1.0.02025-03-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/551f9169d9efadfa85ff5ff512eab17e9219ba10e42636d9a31f1021a1027395?d=identicon)[shuchkin](/maintainers/shuchkin)

---

Top Contributors

[![shuchkin](https://avatars.githubusercontent.com/u/315872?v=4)](https://github.com/shuchkin "shuchkin (42 commits)")[![idugan100](https://avatars.githubusercontent.com/u/102197130?v=4)](https://github.com/idugan100 "idugan100 (2 commits)")[![DieterHolvoet](https://avatars.githubusercontent.com/u/3606531?v=4)](https://github.com/DieterHolvoet "DieterHolvoet (1 commits)")[![livingroot](https://avatars.githubusercontent.com/u/9570664?v=4)](https://github.com/livingroot "livingroot (1 commits)")[![Maikuolan](https://avatars.githubusercontent.com/u/12571108?v=4)](https://github.com/Maikuolan "Maikuolan (1 commits)")

---

Tags

phpparserexcelxlsbackend

### Embed Badge

![Health badge](/badges/shuchkin-simplexls/health.svg)

```
[![Health](https://phpackages.com/badges/shuchkin-simplexls/health.svg)](https://phpackages.com/packages/shuchkin-simplexls)
```

###  Alternatives

[shuchkin/simplexlsx

Parse and retrieve data from Excel XLSx files. MS Excel 2007 workbooks PHP reader.

1.8k3.8M21](/packages/shuchkin-simplexlsx)[avadim/fast-excel-reader

Lightweight and very fast XLSX Excel Spreadsheet Reader in PHP

104608.4k6](/packages/avadim-fast-excel-reader)[avadim/fast-excel-writer

Lightweight and very fast XLSX Excel Spreadsheet Writer in PHP

2951.2M7](/packages/avadim-fast-excel-writer)[shuchkin/simplecsv

Parse and retrieve data from CSV files. Export data to CSV.

5192.4k](/packages/shuchkin-simplecsv)

PHPackages © 2026

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