百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

php-iban

> 编程语言
开源

在 PHP 中生成、解析、验证、纠正错误并显示 IBAN (以及 IIBAN) 银行账户信息。

507 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

在 PHP 中生成、解析、验证、纠正错误并显示 IBAN (以及 IIBAN) 银行账户信息。

php-iban

php-iban is a library for parsing, validating and generating IBAN (and IIBAN) bank account information in PHP. 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 converted 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. IBANs may be obfuscated for presentation to humans in special circumstances such as relative identification. A database of example/test IBANs from different countries is included. Finally, highly accurate suggestions for originally intended input can be made when an incorrect IBAN is detected and is due to mistranscription error.

The parser was built using regular expressions to adapt the contents of the official IBAN registry available from SWIFT then manually modified for special cases such as errors and omissions in SWIFT's official specifications.

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 December 2024 release, ie. PDF release #99.

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

Countries Supported

The following 121 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)
  • Belarus (BY)
  • Cameroon (CM)
  • Cape Verde (CV)
  • Central African Republic (CF)
  • Chad (TD)
  • Comoros (KM)
  • Congo (CG)
  • Costa Rica (CR)
  • Côte d'Ivoire (CI)
  • Croatia (HR)
  • Cyprus (CY)
  • Czech Republic (CZ)
  • Denmark (DK)
  • Faroe Islands (FO)
  • Greenland (GL)
  • Djibouti (DJ)
  • Dominican Republic (DO)
  • Egypt (EG)
  • El Salvador (SV)
  • Equitorial Guinea (GQ)
  • Estonia (EE)
  • Falkland Islands (FK)
  • 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)
  • Gabon (GA)
  • Georgia (GE)
  • Germany (DE)
  • Gibraltar (GI)
  • Greece (GR)
  • Guatemala (GT)
  • Guinea-Bissau (GW)
  • Honduras (HN)
  • Hungary (HU)
  • Iceland (IS)
  • IIBAN (Internet) (AA)
  • Iran (IR)
  • Iraq (IQ)
  • Ireland (IE)
  • Israel (IL)
  • Italy (IT)
  • Jordan (JO)
  • Kazakhstan (KZ)
  • Kosovo (XK)
  • Kuwait (KW)
  • Latvia (LV)
  • Lebanon (LB)
  • Libya (LY)
  • Liechtenstein (LI)
  • Lithuania (LT)
  • Luxembourg (LU)
  • Macedonia (MK)
  • Madagascar (MG)
  • Mali (ML)
  • Malta (MT)
  • Mauritania (MR)
  • Mauritius (MU)
  • Moldova (MD)
  • Monaco (MC)
  • Mongolia (MN)
  • Montenegro (ME)
  • Morocco (MA)
  • Mozambique (MZ)
  • Netherlands (NL)
  • Nicaragua (NI)
  • Niger (NE)
  • Norway (NO)
  • Oman (OM)
  • Pakistan (PK)
  • Palestine (PS)
  • Poland (PL)
  • Portugal (PT)
  • Qatar (QA)
  • Romania (RO)
  • Russian Federation (RU)
  • 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)
  • Sudan (SD)
  • Sweden (SE)
  • Switzerland (CH)
  • Timor-Leste (TL)
  • Togo (TG)
  • Tunisia (TN)
  • Turkey (TR)
  • Ukraine (UA)
  • United Arab Emirates (AE)
  • United Kingdom (GB)
  • Vatican (Holy See) (VA)
  • Yemen (YE)

Installation via composer

If you use composer you can simply run composer require globalcitizen/php-iban to get going. Reportedly (and ) 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:

javascript
// composer.json
{
    "require": {
        "globalcitizen/php-iban": "4.2.3"
    }
}

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

bash
# 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.

Installation via git

For a regular install, use the git clone command:

bash
# HTTP
$ git clone https://github.com/globalcitizen/php-iban.git
# SSH
$ git clone [email protected]:globalcitizen/php-iban.git

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:

bash
# 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:

bash
# check out your project as normal
$ git clone [email protected]: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:

bash
# check out your project, initialize and update all submodules
$ git clone --recursive [email protected]:your/project.git

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

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

Manual installation

  1. Fetch the latest release from our github releases page 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() statement:
php

Comparison of PHP IBAN libraries

The following table compares php-iban to other PHP projects offering IBAN-related functionality, on the basis of general project information and the programming paradigms supported.

Project Lic. Proc OO Began Latest Star Watch Fork Installs Home culture Deps
php-iban LGPL ✔ ✔ 2009 4.2.3 426 29 104 ~7M+* Global* none
Iban MIT ✘ ✔ 2013 1.3.0 50 9 19 178.39k German lots
IsoCodes GPL3 ✘ ✔ 2012 2.1.1 466 22 54 145k French lots
SepaUtil's GPL3 ✘ ✔ 2014 1.2.3 8 4 3 25k German phpunit
Symfony MIT ✘ ✔ 2013 3.3.6 15k 1214 5.6k 23M+ French lots

Notes:

  • Original download records for php-iban releases were hosted on Google Code and are now lost. Prior to establishing a release process on Github, we just expected that people would download the code... so we're really not sure how many installs exist, but this is a fair guess (now over 3M composer installs + all prior google code and Github installs).
  • php-iban also powers:
    • adm-gravity-iban
    • Azzana consulting's XML Solver for ISO20022
    • basepa Payment Gateway for WooCommerce
    • org.civicoop.ibanaccounts extension for CiviCoop
    • commerce_sepa
    • contao-haste_plus
    • Dolibarr ERP & CRM (website)
    • fieldwork: Web forms for cool people
    • IBAN Validator for Drupal
    • identity component for Laravel to check Spanish IDs
    • lib-bankaccount (conversion to/from legacy German account format)
    • PHP SEPA XML class (github)
    • Project60 SEPA direct debit
    • SEPA Payment Plugin for SubsGuru
    • Silverstripe CMS module
    • statement
    • WooCommerce Germanized
    • WooCommerce SEPA Payment Gateway
  • php-iban's author is an Australian born, Australia/New Zealand/German citizen who has formerly also worked and banked in the US, UK, and many Asian countries.
  • The IsoCodes and SepaUtil's projects cover standards other than IBAN so their popularity should be considered in this light. (In essence, there is really only one directly competing library, Iban)

Now let's take a look at features.

|

Issues· 6 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHPchecksumsecbsianaiban

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言