{"id":18610561,"url":"https://github.com/ixnode/php-iban","last_synced_at":"2025-07-30T08:05:18.505Z","repository":{"id":192070241,"uuid":"686164386","full_name":"ixnode/php-iban","owner":"ixnode","description":"PHP IBAN - This library provides a converter for account number, bank code and IBAN.","archived":false,"fork":false,"pushed_at":"2024-06-04T20:15:45.000Z","size":146,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-14T05:09:34.695Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ixnode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-01T23:08:08.000Z","updated_at":"2024-10-09T10:17:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"634f09f7-5c84-42c6-b8a1-98646d13bc9e","html_url":"https://github.com/ixnode/php-iban","commit_stats":null,"previous_names":["ixnode/php-iban"],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/ixnode/php-iban","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-iban","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-iban/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-iban/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-iban/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ixnode","download_url":"https://codeload.github.com/ixnode/php-iban/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-iban/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267834754,"owners_count":24151638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T03:11:03.648Z","updated_at":"2025-07-30T08:05:18.066Z","avatar_url":"https://github.com/ixnode.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP IBAN\n\n[![Release](https://img.shields.io/github/v/release/ixnode/php-iban)](https://github.com/ixnode/php-iban/releases)\n[![](https://img.shields.io/github/release-date/ixnode/php-iban)](https://github.com/ixnode/php-iban/releases)\n![](https://img.shields.io/github/repo-size/ixnode/php-iban.svg)\n[![PHP](https://img.shields.io/badge/PHP-^8.2-777bb3.svg?logo=php\u0026logoColor=white\u0026labelColor=555555\u0026style=flat)](https://www.php.net/supported-versions.php)\n[![PHPStan](https://img.shields.io/badge/PHPStan-Level%20Max-777bb3.svg?style=flat)](https://phpstan.org/user-guide/rule-levels)\n[![PHPUnit](https://img.shields.io/badge/PHPUnit-Unit%20Tests-6b9bd2.svg?style=flat)](https://phpunit.de)\n[![PHPCS](https://img.shields.io/badge/PHPCS-PSR12-416d4e.svg?style=flat)](https://www.php-fig.org/psr/psr-12/)\n[![PHPMD](https://img.shields.io/badge/PHPMD-ALL-364a83.svg?style=flat)](https://github.com/phpmd/phpmd)\n[![Rector - Instant Upgrades and Automated Refactoring](https://img.shields.io/badge/Rector-PHP%208.2-73a165.svg?style=flat)](https://github.com/rectorphp/rector)\n[![LICENSE](https://img.shields.io/github/license/ixnode/php-api-version-bundle)](https://github.com/ixnode/php-api-version-bundle/blob/master/LICENSE)\n\n\u003e This library provides a converter for account number, bank code and IBAN.\n\n## 1. Usage\n\nSome usage examples.\n\n### 1.1 IBAN parser example\n\n```php\nuse Ixnode\\PhpIban\\Iban;\nuse Ixnode\\PhpIban\\Validator;\n\n...\n\n$iban = 'DE02120300000000202051';\n$validator = new Validator(new Iban($iban));\n\nprint $validator-\u003eisValid() ? 'YES' : 'NO';\n// (string) YES\n\nprint $validator-\u003egetAccount()-\u003egetAccountNumber();\n// (string) 0000202051\n\nprint $validator-\u003egetIban()-\u003egetIbanFormatted();\n// (string) DE02 1203 0000 0000 2020 51\n\netc.\n```\n\n### 1.2 Account number and bank code converter example (AT, CH, DE, LI, etc.)\n\n```php\nuse Ixnode\\PhpIban\\Account;\n\n...\n\n$accountNumber = '0000202051';\n$bankCode = '12030000';\n$countryCode = 'DE';\n$account = new Account($accountNumber, $bankCode, $countryCode);\n\nprint $account-\u003egetIban();\n// (string) DE02120300000000202051\n\nprint $account-\u003egetIbanFormatted();\n// (string) DE02 1203 0000 0000 2020 51\n```\n\n### 1.3 Account number and bank code converter example (FR)\n\n```php\nuse Ixnode\\PhpIban\\Account;\nuse Ixnode\\PhpIban\\Constant\\IbanFormats;\n\n...\n\n$accountNumber = '00020053701';\n$bankCode = '30027';\n$countryCode = 'FR';\n$branchCode = '17533';\n$nationalCheckDigits = '59';\n$account = new Account($accountNumber, $bankCode, $countryCode, [\n    IbanFormat::KEY_BRANCH_CODE =\u003e $branchCode,\n    IbanFormat::KEY_NATIONAL_CHECK_DIGITS =\u003e $nationalCheckDigits,\n]);\n\nprint $account-\u003egetIban();\n// (string) FR7630027175330002005370159\n\nprint $account-\u003egetIbanFormatted();\n// (string) FR76 3002 7175 3300 0200 5370 159\n```\n\n## 2. Supported countries\n\nChecked countries and added tests (other countries might work too):\n\n* AD (Andorra)\n* AE (United Arab Emirates)\n* AL (Albania)\n* AT (Austria)\n* AZ (Azerbaijan)\n* BA (Bosnia and Herzegovina)\n* BE (Belgium)\n* BG (Bulgaria)\n* BH (Bahrain)\n* BR (Brazil)\n* BY (Belarus)\n* CH (Switzerland)\n* CR (Costa Rica)\n* CY (Cyprus)\n* CZ (Czechia)\n* DE (Germany)\n* DK (Denmark)\n* DO (Dominican Republic)\n* EE (Estonia)\n* EG (Egypt)\n* ES (Spain)\n* FI (Finland)\n* FO (Faroe Islands)\n* FR (France)\n* GB (United Kingdom of Great Britain and Northern Ireland)\n* GE (Georgia)\n* GI (Gibraltar)\n* GL (Greenland)\n* GR (Greece)\n* GT (Guatemala)\n* HR (Croatia)\n* HU (Hungary)\n* IE (Ireland)\n* IL (Israel)\n* IQ (Iraq)\n* IS (Iceland)\n* IT (Italy)\n* JO (Jordan)\n* KW (Kuwait)\n* KZ (Kazakhstan)\n* LB (Lebanon)\n* LC (Saint Lucia)\n* LI (Liechtenstein)\n* LT (Lithuania)\n* LU (Luxembourg)\n* LV (Latvia)\n* MC (Monaco)\n* ME (Montenegro)\n* MD (Moldova)\n* MK (North Macedonia)\n* MR (Mauritania)\n* MT (Malta)\n* MU (Mauritius)\n* NL (Netherlands)\n* NO (Norway)\n* PK (Pakistan)\n* PL (Poland)\n* PS (Palestine)\n* PT (Portugal)\n* QA (Qatar)\n* RO (Romania)\n* RS (Serbia)\n* SA (Saudi Arabia)\n* SC (Seychelles)\n* SE (Sweden)\n* SI (Slovenia)\n* SK (Slovakia)\n* SM (San Marino)\n* ST (Sao Tome and Principe)\n* SV (El Salvador)\n* TN (Tunisia)\n* TL (Timor-Leste)\n* TR (Turkey)\n* VG (Virgin Islands)\n* UA (Ukraine)\n* XK (Kosovo)\n\nAll added countries you can find here: `Ixnode\\PhpIban\\Constant\\IbanFormats::IBAN_FORMATS`\n\nSee https://en.wikipedia.org/wiki/International_Bank_Account_Number#IBAN_formats_by_country to add more countries.\n\n## 3. Installation\n\n```bash\ncomposer require ixnode/php-iban\n```\n\n```bash\nvendor/bin/php-iban -V\n```\n\n```bash\n0.1.0 (2023-09-01 21:09:52) - Björn Hempel \u003cbjoern@hempel.li\u003e\n```\n\n## 4. Command line tool\n\n### 4.1 Check IBAN number\n\n\u003e Used to quickly check a given IBAN number.\n\n```bash\nbin/console iban:validate MU17BOMM0101101030300200000MUR\n```\n\nor within your composer project:\n\n```bash\nbin/console iban:validate MU17BOMM0101101030300200000MUR\n```\n\n```bash\n\nGiven IBAN:     MU17BOMM0101101030300200000MUR\n\nParsed IBAN\n-----------\nValid:                           YES\nLast error:                      N/A\nIBAN:                            MU17BOMM0101101030300200000MUR\nIBAN:                            MU17 BOMM 0101 1010 3030 0200 000M UR\nChecksum:                        17\nFormat:                          MUkkbbbbbbsscccccccccccc000mmm\nParts:                           country-code=MU, iban-check-digits=17, national-bank-code=BOMM01, branch-code=01, account-number=101030300200, number=000, currency-code=MUR\n\nAccount\n-------\nCountry:                         MU (Mauritius)\nChecksum:                        17\nBalance cccount number:          N/A\nNational bank code:              BOMM01\nAccount number:                  101030300200\nNational identification number:  N/A\nCurrency code:                   MUR\nOwner account number:            N/A\nAccount number prefix:           N/A\nBic bank code:                   N/A\nBranch code:                     01\nAccount type:                    N/A\nNational check digits:           N/A\nIBAN (from account):             MU17BOMM0101101030300200000MUR\nIBAN (from account):             MU17 BOMM 0101 1010 3030 0200 000M U\n\n```\n\n### 4.2 Generate IBAN number\n\n\u003e Used to quickly generate an IBAN number.\n\n```bash\nbin/console account-number:validate 0000202051 12030000\n```\n\nor within your composer project:\n\n```bash\nvendor/bin/php-iban account-number:validate 0000202051 12030000\n```\n\n```bash\n\nGiven account number: 0000202051\nGiven bank code:      12030000\nGiven country code:   DE\n\nParsed IBAN\n-----------\nIBAN:           DE02120300000000202051\nValid:          YES\nLast error:     N/A\nCountry:        DE\nChecksum:       02\nAccount number: 0000202051\nBank number:    12030000\n\n```\n\n## 5. Library development\n\n```bash\ngit clone git@github.com:ixnode/php-iban.git \u0026\u0026 cd php-iban\n```\n\n```bash\ncomposer install\n```\n\n```bash\ncomposer test\n```\n\n## 6. License\n\nThis library is licensed under the MIT License - see the [LICENSE](/LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fixnode%2Fphp-iban","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fixnode%2Fphp-iban","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fixnode%2Fphp-iban/lists"}