Skip to content

International Bank Account Numbers (IBAN)

elcapo edited this page Oct 16, 2014 · 11 revisions

IBAN are the initials for International Bank Account Number, a new standard adopted by (basically) the European Union to simplify communications between banks.

In general, an IBAN is build by adding the two characters of the ISO code of the country where the account was created, plus two additional check digits. For instance, the Spanish bank account number 1234 5678 06 1234567890 corresponds with the IBAN ES68 1234 5678 0612 3456 7890.

These functions can help both to calculate the corresponding check digits and to validate the digits of a given account.

Code and tests

Validate String Format

isValidIBAN allow us to easily check an IBAN. It gets a string as parameter and returns 0 (false) or 1 (true), after validating both the formats and corresponding check digits.

Obtain Information

These functions allow us to obtain useful information to work with IBANs. The getIBANCheckDigits function, for instance, returns the check digits for a given IBAN.

Other related functions are getAccountLength and getGlobalIdentifier.

Additional Tasks & Helpers

Some functions have been written just to be used by other functions but they can still be called directly. For instance, isSepaCountry, replaceCharactersNotInPattern and replaceLetterWithDigits.

SEPA validations

  • [International Bank Account Numbers (IBAN)](International Bank Account Numbers (IBAN))

Spanish validations

Helpers

  • [Common functions](Common functions)
Clone this wiki locally