PHPackages                             renekorss/phpexcelformatter - 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. renekorss/phpexcelformatter

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

renekorss/phpexcelformatter
===========================

PHPExcelFormatter is class to make it more simple to get data from Excel documents.

3.0.1(5y ago)43.1k↓50%2MITPHPPHP ^7.2CI failing

Since Sep 16Pushed 5y ago3 watchersCompare

[ Source](https://github.com/renekorss/excel-formatter-php)[ Packagist](https://packagist.org/packages/renekorss/phpexcelformatter)[ Docs](https://github.com/renekorss/PHPExcelFormatter)[ RSS](/packages/renekorss-phpexcelformatter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (5)Used By (0)

[![Actions Status](https://github.com/renekorss/excel-formatter-php/workflows/build/badge.svg)](https://github.com/renekorss/excel-formatter-php/actions)[![Coverage Status](https://camo.githubusercontent.com/c82b730592dc4924434d49c4d6468379aa0491a2c9cf2d0bdbed13a9eaca8155/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f72656e656b6f7273732f657863656c2d666f726d61747465722d7068702f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/renekorss/excel-formatter-php?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/91a958a5bb62863546bc68042d55a21360ba6cdb5fdcde46829120c4c9236ba0/68747470733a2f2f706f7365722e707567782e6f72672f72656e656b6f7273732f706870657863656c666f726d61747465722f762f737461626c65)](https://packagist.org/packages/renekorss/phpexcelformatter)[![Total Downloads](https://camo.githubusercontent.com/61295902bcad7adff9af3627f962c238e0cab2e082dfe3166b8832eab8097107/68747470733a2f2f706f7365722e707567782e6f72672f72656e656b6f7273732f706870657863656c666f726d61747465722f646f776e6c6f616473)](https://packagist.org/packages/renekorss/phpexcelformatter)[![License](https://camo.githubusercontent.com/74ea3d774c5103e6783dc09d57ef2525e1ddb80fee772cd83c2f766cf7e62e78/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

PHPExcelFormatter
=================

[](#phpexcelformatter)

PHPExcelFormatter is class to make getting data from Excel documents simpler.

- Read columns what you really need
- Set column names for documents what dosen't have column names on first row
- Set your DB field names for columns
- Retrieve data in array or MySQL query format
- Greate for importing files and then letting user to connect document columns with your DB fields :) (example coming)

Install
-------

[](#install)

```
composer require renekorss/phpexcelformatter

```

Usage
-----

[](#usage)

```
// Require needed files
require __DIR__ . '/vendor/autoload.php';

use RKD\PHPExcelFormatter\PHPExcelFormatter;
use RKD\PHPExcelFormatter\Exception\PHPExcelFormatterException;

try {
  // Load file
  $formatter = new PHPExcelFormatter('example1.xls');

  // Output columns array (document must have column names on first row)
  $formatterColumns = array(
    'username' => 'username',
    'phone'    => 'phone_no',
    'email'    => 'email_address'
  );

  // Output columns array (document dosen't have column names on first row)
  // Skip fourth column (age) (third in array), because we don't need that data
  // NOTE: if document dosen't have column names on first line, second parameter for PHPExcelFormatter should be $readColumns = false, otherwise it will skip first line of data
  $formatterColumns = array(
    'username',
    'email_address',
    'phone',
    4 => 'sex'
  );

  // Set our columns
  $formatter->setFormatterColumns($formatterColumns);

  // Output as array
  $output = $formatter->output('a');
  // OR
  // $output = $formatter->output('array');

  // Print array
  echo ''.print_r($output, true).'';

  // Set MySQL table
  $formatter->setMySQLTableName('users');

  // Output as mysql query
  $output = $formatter->output('m');
  // OR
  // $output = $formatter->output('mysql');

  // Print mysql query
  echo ''.print_r($output, true).'';

} catch (PHPExcelFormatterException $e) {
  echo 'Error: '.$e->getMessage();
}
```

View [examples](examples)

License
-------

[](#license)

PHPExcelFormatter is licensed under [MIT](LICENSE)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 97.7% 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 ~475 days

Total

4

Last Release

2107d ago

Major Versions

v2.0.1 → 3.0.02020-08-10

PHP version history (2 changes)v2.0.0PHP &gt;=5.2.0

3.0.0PHP ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/2300b3392c5534fe07c444ba2a0b3e12f745265a76683dbf8e61691032acb7a8?d=identicon)[renekorss](/maintainers/renekorss)

---

Top Contributors

[![renekorss](https://avatars.githubusercontent.com/u/1494080?v=4)](https://github.com/renekorss "renekorss (42 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

excelformatterofficephpphpexcelxlsxlsxformatspreadsheet

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/renekorss-phpexcelformatter/health.svg)

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

###  Alternatives

[avadim/fast-excel-writer

Lightweight and very fast XLSX Excel Spreadsheet Writer in PHP

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

Lightweight and very fast XLSX Excel Spreadsheet Reader in PHP

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

PHPackages © 2026

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