Skip to content
elcapo edited this page Oct 16, 2014 · 4 revisions

isSepaCountry helps to check the first two digits of an IBAN. These two digits are referring to the country where the account was created, so they only can correspond to one of the countries in the Single Euro Payments Area (SEPA) area.

A document with a full list of the SEPA countries, its corresponding IBAN structures and more is available at the Swift website as IBAN Registry.

Usage

/* MySQL */
SELECT isSepaCountry( 'ES' ); /* Returns 1 */
SELECT isSepaCountry( 'CN' ); /* Returns 0 */
/* JavaScript */
var isSEPA = isSepaCountry( 'ES' ); /* isSEPA = 1 */
var isSEPA = isSepaCountry( 'CN' ); /* isSEPA = 0 */
/* PHP */
$isSEPA = isSepaCountry( 'ES' ); /* $isSEPA = 1 */
$isSEPA = isSepaCountry( 'CN' ); /* $isSEPA = 0 */

Return values

  • 1 - If specified country is part of the SEPA.
  • 0 - Otherwise.

Dependencies

In order to say if an account is a SEPA account, or not, this function checks if there is a predefined IBAN length for the given country. To do so, it uses getAccountLength.

Category

This function is part of the [International Bank Account Numbers (IBAN)](International Bank Account Numbers (IBAN)) package.

SEPA validations

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

Spanish validations

Helpers

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