PHPackages                             oguzcabuk07/php-iban - 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. oguzcabuk07/php-iban

ActiveLibrary

oguzcabuk07/php-iban
====================

php-iban is a library for parsing and validating IBAN (and IIBAN) bank account information.

v3.0.1(4y ago)126LGPL-3.0PHP

Since Jan 19Pushed 4y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (48)Used By (0)

php-iban
========

[](#php-iban)

`php-iban` is a library for parsing, validating and generating IBAN (and IIBAN) bank account information in PHP.

[![Build Status](https://camo.githubusercontent.com/71419eae04ea7d78ac8eb894f8b479b9f277cf4fc35293f36ce9784083dedeab/68747470733a2f2f7472617669732d63692e6f72672f676c6f62616c636974697a656e2f7068702d6962616e2e706e67)](https://travis-ci.org/globalcitizen/php-iban)[![Latest Stable Version](https://camo.githubusercontent.com/ad9a81f34b232193db38799ac25d20f6d42b8686f04d93a894e4799249155664/68747470733a2f2f706f7365722e707567782e6f72672f676c6f62616c636974697a656e2f7068702d6962616e2f762f737461626c65)](https://packagist.org/packages/globalcitizen/php-iban)[![License](https://camo.githubusercontent.com/0463c2524cd20f492806ee56da7a590802737df6b667076ddab50d7e97de0568/68747470733a2f2f706f7365722e707567782e6f72672f676c6f62616c636974697a656e2f7068702d6962616e2f6c6963656e7365)](https://packagist.org/packages/globalcitizen/php-iban)

All parts of an IBAN can be retrieved, including country code, checksum, BBAN, financial institution or bank code, account number, and where a fixed-length national system is in use, also branch/sort code. Legacy national checksums may also be retrieved, validated and correctly set, where available, whether they apply to the account number portion, bank and branch identifiers, part or all of the above. IBAN country codes can be coverted in to ISO3166-1 alpha-2 and IANA formats, the parent IBAN country acting as registrar for dependent territories may be queried, the official national currency (ISO4217 alpha code format), central bank name and central bank URL may also be queried to ease integration. IBANs may be converted between human and machine representation. Finally, highly accurate suggestions for originally intended input can be made when an incorrect IBAN is detected and is due to mistranscription error.

Tested on PHP versions [![PHP 5.3](https://camo.githubusercontent.com/3ca7edd1dfd3a02990799e336113188aa5cfd0a61ace5cc1c6246aecff814598/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d504850253230352e332532422d6c69676874677265792e737667)](https://camo.githubusercontent.com/3ca7edd1dfd3a02990799e336113188aa5cfd0a61ace5cc1c6246aecff814598/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d504850253230352e332532422d6c69676874677265792e737667) [![PHP 5.4](https://camo.githubusercontent.com/de1d3a23aaaf6f3f20d5d84e20df74755202c22a12c29580f26fd071bf61a455/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d504850253230352e342532422d6c69676874677265792e737667)](https://camo.githubusercontent.com/de1d3a23aaaf6f3f20d5d84e20df74755202c22a12c29580f26fd071bf61a455/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d504850253230352e342532422d6c69676874677265792e737667) [![PHP 5.5](https://camo.githubusercontent.com/89e10cfaea3881f854429f19472e48732d12bc987ef3777b39b5e1d4e2bff023/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d504850253230352e352532422d6c69676874677265792e737667)](https://camo.githubusercontent.com/89e10cfaea3881f854429f19472e48732d12bc987ef3777b39b5e1d4e2bff023/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d504850253230352e352532422d6c69676874677265792e737667) [![PHP 5.6](https://camo.githubusercontent.com/18641407980f657c074756b6c6c6d3dba6907e452656d46dbf6ea19c04fd4cf0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d504850253230352e362532422d6c69676874677265792e737667)](https://camo.githubusercontent.com/18641407980f657c074756b6c6c6d3dba6907e452656d46dbf6ea19c04fd4cf0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d504850253230352e362532422d6c69676874677265792e737667) [![PHP 7.0](https://camo.githubusercontent.com/dd190a8ddf118c9a3132d46a70db73e1ee81d2d8b5bb0ed906df63dcb4314b54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d504850253230372e302532422d6c69676874677265792e737667)](https://camo.githubusercontent.com/dd190a8ddf118c9a3132d46a70db73e1ee81d2d8b5bb0ed906df63dcb4314b54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d504850253230372e302532422d6c69676874677265792e737667) as well as HHVM and nightly.

The parser was built using regular expressions to adapt the contents of the *official* IBAN registry available from SWIFT at  then only manually modified for special cases such as [errors and omissions in SWIFT's official specifications](https://raw.githubusercontent.com/globalcitizen/php-iban/master/docs/COMEDY-OF-ERRORS).

Various deficiencies in the initial adaptation have since been rectified, and the current version should be a fairly correct and reliable implementation.

Where appropriate, **European Committee for Banking Standards** (ECBS) recommendations have also been incorporated.

Please bear in mind that because the specification changes frequently, it may not be 100% up to date if a new version has been recently released - I do my best though. We are currently thought to be up to date with [the April 2016 release, ie. PDF release #65](https://www.swift.com/sites/default/files/resources/swift_standards_ibanregistry.pdf).

Licensed under LGPL, it is free to use in commercial settings.

Countries Supported
-------------------

[](#countries-supported)

The following 99 official and *unofficial* IBAN countries are supported.

- Albania (AL)
- *Algeria* (DZ)
- Andorra (AD)
- *Angola* (AO)
- Austria (AT)
- Azerbaijan (AZ)
- Bahrain (BH)
- Belgium (BE)
- *Benin* (BJ)
- Bosnia and Herzegovina (BA)
- Brazil (BR)
- British Virgin Islands (VG)
- Bulgaria (BG)
- *Burkina Faso* (BF)
- *Burundi* (BI)
- *Cameroon* (CM)
- *Cape Verde* (CV)
- Costa Rica (CR)
- *Côte d'Ivoire* (CI)
- Croatia (HR)
- Cyprus (CY)
- Czech Republic (CZ)
- Denmark (DK)
- Faroe Islands (FO)
- Greenland (GL)
- Dominican Republic (DO)
- Estonia (EE)
- Finland (FI)
- Åland Islands (AX)
- France (FR)
- French Guiana (GF)
- French Polynesia (PF)
- French Southern Territories (TF)
- Guadelope (GP)
- Martinique (MQ)
- Mayotte (YT)
- New Caledonia (NC)
- Réunion (RE)
- Saint Barhélemy (BL)
- Saint Martin (French Part) (MF)
- Saint-Pierre and Miquelon (PM)
- Wallis and Futuna (WF)
- Georgia (GE)
- Germany (DE)
- Gibraltar (GI)
- Greece (GR)
- Guatemala (GT)
- Hungary (HU)
- Iceland (IS)
- *IIBAN (Internet)* (AA)
- *Iran* (IR)
- Ireland (IE)
- Israel (IL)
- Italy (IT)
- Jordan (JO)
- Kazakhstan (KZ)
- Kosovo (XK)
- Kuwait (KW)
- Latvia (LV)
- Lebanon (LB)
- Liechtenstein (LI)
- Lithuania (LT)
- Luxembourg (LU)
- Macedonia (MK)
- *Madagascar* (MG)
- *Mali* (ML)
- Malta (MT)
- Mauritania (MR)
- Mauritius (MU)
- Moldova (MD)
- Monaco (MC)
- Montenegro (ME)
- *Mozambique* (MZ)
- Netherlands (NL)
- Norway (NO)
- Pakistan (PK)
- Palestine (PS)
- Poland (PL)
- Portugal (PT)
- Qatar (QA)
- Romania (RO)
- Saint Lucia (LC)
- San Marino (SM)
- São Tomé and Príncipe (ST)
- Saudi Arabia (SA)
- *Senegal* (SN)
- Serbia (RS)
- Seychelles (SC)
- Slovakia (SK)
- Slovenia (SI)
- Spain (ES)
- Sweden (SE)
- Switzerland (CH)
- Timor-Leste (TL)
- Tunisia (TN)
- Turkey (TR)
- *Ukraine* (UA)
- United Arab Emirates (AE)
- United Kingdom (GB)

Installation via composer
-------------------------

[](#installation-via-composer)

If you use [composer](https://getcomposer.org/) you can simply run `composer require globalcitizen/php-iban` to get going. Reportedly [![Daily Downloads](https://camo.githubusercontent.com/423ce60b62c4c7edca76c200e7ad53cc4a1a8d533585d82ea74552c860dcdc26/68747470733a2f2f706f7365722e707567782e6f72672f676c6f62616c636974697a656e2f7068702d6962616e2f642f6461696c79)](https://packagist.org/packages/globalcitizen/php-iban) (and [![Monthly Downloads](https://camo.githubusercontent.com/20b786ac6684982c739ad8b8cf30991b7649a9631802cdb38f5c4310f1f3124c/68747470733a2f2f706f7365722e707567782e6f72672f676c6f62616c636974697a656e2f7068702d6962616e2f642f6d6f6e74686c79)](https://packagist.org/packages/globalcitizen/php-iban)) were done via composer.

(If you don't yet have `composer` and wish to install it in an insecure fashion (not recommended, but convenient) you can run `curl -sS https://getcomposer.org/installer | php` or `wget -O- https://getcomposer.org/installer | php`)

Then just add the following to your `composer.json` file:

```
// composer.json
{
    "require": {
        "globalcitizen/php-iban": "2.5.5"
    }
}
```

Then, you can install the new dependencies by running `composer`'s update command from the directory where your `composer.json` file is located:

```
# install
$ php composer.phar install
# update
$ php composer.phar update globalcitizen/php-iban

# or you can simply execute composer command if you set it to
# your PATH environment variable
$ composer install
$ composer update globalcitizen/php-iban
```

You can [see this library on Packagist](https://packagist.org/packages/globalcitizen/php-iban).

Installation via git
--------------------

[](#installation-via-git)

For a regular install, use the `git clone` command:

```
# HTTP
$ git clone https://github.com/globalcitizen/php-iban.git
# SSH
$ git clone git@github.com:globalcitizen/php-iban.git
```

Installation via git submodule
------------------------------

[](#installation-via-git-submodule)

Alternatively, to embed the `php-iban` library in your own `git`-managed repository at a specific revision number, such that it is possible to update the version in a predictable way while maintaining a larger system that depends upon its functionality:

```
# enter your project's git repo
$ cd my-existing-project-with-a-git-repo/
# select an appropriate place to create the php-iban subdir
$ cd lib/
# add php-iban as a submodule
$ git submodule add https://github.com/globalcitizen/php-iban.git
# commit new submodule
$ git commit -m 'Add php-iban submodule'
```

Then, when checking out `git` projects with submodules for the first time, normally you need to make a couple of extra steps:

```
# check out your project as normal
$ git clone git@your-server.com:your/project.git
# initialize submodules
$ git submodule init
# update submodules
$ git submodule update
```

To skip these steps, add the `--recursive` argument to `git clone` when checking out:

```
# check out your project, initialize and update all submodules
$ git clone --recursive git@your-server.com:your/project.git
```

If you later wish to your project to use a newer version of `php-iban`, run:

```
# fetch changes
$ git submodule update --remote php-iban
# commit
$ git commit -m 'Update php-iban submodule'
```

Manual installation
-------------------

[](#manual-installation)

1. Fetch the latest release from [our github releases page](https://github.com/globalcitizen/php-iban/releases) in either `zip` or `tar.gz` format.
2. Extract the library using your favourite archive utility, for example `unzip filename.zip` on Unix-like platforms.
3. Write your code to depend on the library based upon its relative location to your source code. For example if you wish to include `php-iban` from the parent directory's subdirectory `libraries/php-iban` you could use the following [require\_once()](http://php.net/manual/en/function.require-once.php) statement:

```
