PHPackages                             chekalskiy/php-bank-db - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. chekalskiy/php-bank-db

Abandoned → [chekalskiy/php-banks-db](/?search=chekalskiy%2Fphp-banks-db)Library[Utility &amp; Helpers](/categories/utility)

chekalskiy/php-bank-db
======================

PHP bank cards IIN/BIN database. Get bank info by card number

v0.3.4(5y ago)1385.8k19[1 PRs](https://github.com/chekalskiy/php-banks-db/pulls)MITPHPPHP &gt;=7.2CI passing

Since Jul 2Pushed 11mo ago6 watchersCompare

[ Source](https://github.com/chekalskiy/php-banks-db)[ Packagist](https://packagist.org/packages/chekalskiy/php-bank-db)[ Docs](https://github.com/chekalsky/php-banks-db)[ RSS](/packages/chekalskiy-php-bank-db/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (3)Versions (14)Used By (0)

PHP Banks DB
============

[](#php-banks-db)

[![PHP Tests](https://github.com/chekalsky/php-banks-db/actions/workflows/ci.yml/badge.svg)](https://github.com/chekalsky/php-banks-db/actions/workflows/ci.yml)

> It is a PHP port of [ramoona's banks-db](https://github.com/ramoona/banks-db).

Returns bank's name and brand color by bank card number's first digits (BIN, Issuer Identification Numbers, IIN).

### Installation

[](#installation)

```
composer require chekalskiy/php-banks-db

```

### Basic usage

[](#basic-usage)

```
$card_prefix = '5275 9400 0000 0000'; // we only need first 6 digits but it could be the whole card number

try {
    $bank_db = new BankDb();
    $bank_info = $bank_db->getBankInfo($card_prefix);

    $result = [
        'is_unknown' => $bank_info->isUnknown(), // is bank unknown
        'name' => $bank_info->getTitle(true),
        'color' => $bank_info->getColor(),
        'type' => $bank_info->getCardType(),
    ];

    return $result;
} catch (BankDbException $e) {
    // todo handle exception
}
```

### About database

[](#about-database)

We use simple PHP-file with an array inside (it's regenerates every time ramoona's repository is updated). It's very fast and simple way to work with data because of opcache enabled by default in PHP 7. But you can extend `BankDB` class to make it work with redis or something, but for most cases compiled php-file is OK.

#### Database update

[](#database-update)

Database updates from [original library](https://github.com/ramoona/banks-db) by me. To update php cache file after manual database change run `composer rebuild`.

### Contributions

[](#contributions)

Feel free to open [an issue](https://github.com/chekalskiy/php-banks-db/issues) on every question you have. If you have new prefixes for database please commit them to [ramoona/banks-db repository](https://github.com/ramoona/banks-db) — I will update them once your PR will me merged there.

---

> It's a community driven database, so it can potentially contains mistakes.

For UI examples see the [original library](https://github.com/ramoona/banks-db).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~110 days

Recently: every ~191 days

Total

10

Last Release

1920d ago

PHP version history (3 changes)v0.1.1PHP &gt;=7.0

v0.2PHP &gt;=7.1

v0.3PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a23d829168f130bd1e8113dd18c0e490d02d47c2f455b90ed2197ab0e04b228?d=identicon)[chekalskiy](/maintainers/chekalskiy)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (4 commits)")[![chekalsky](https://avatars.githubusercontent.com/u/241584?v=4)](https://github.com/chekalsky "chekalsky (3 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (2 commits)")[![Phrlog](https://avatars.githubusercontent.com/u/9060150?v=4)](https://github.com/Phrlog "Phrlog (1 commits)")

---

Tags

bankbank-cardbanks-dbbincredit-cardiincreditcardcardbinIINissuer identification numbers

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/chekalskiy-php-bank-db/health.svg)

```
[![Health](https://phpackages.com/badges/chekalskiy-php-bank-db/health.svg)](https://phpackages.com/packages/chekalskiy-php-bank-db)
```

###  Alternatives

[chekalskiy/php-banks-db

PHP bank cards IIN/BIN database. Get bank info by card number

15293.6k](/packages/chekalskiy-php-banks-db)[digital-creative/resource-navigation-tab

Organize your resource fields into tabs.

78150.5k](/packages/digital-creative-resource-navigation-tab)[ericlagarda/nova-text-card

A custom card for Laravel Nova to show Text in cards with some good options

20406.3k2](/packages/ericlagarda-nova-text-card)[phar-io/composer-distributor

Base Code for a composer plugin that installs PHAR-files

13715.6k8](/packages/phar-io-composer-distributor)[ffi/location

PHP library for determining the physical location of binaries

1339.8k7](/packages/ffi-location)[digital-creative/resource-navigation-link

Create links to internal or external resources.

1047.4k](/packages/digital-creative-resource-navigation-link)

PHPackages © 2026

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