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

getAccountLength returns the expected length for an IBAN given its first two digits. For instance, British accounts have 22 characters when written in IBAN electronic format.

Usage

/* MySQL */
SELECT getAccountLength( 'GB' ); /* Returns 22 */
SELECT getAccountLength( 'CN' ); /* Returns 0 */
/* JavaScript */
var length = getAccountLength( 'GB' ); /* length = 22 */
var length = getAccountLength( 'CN' ); /* length = 0 */
/* PHP */
$length = getAccountLength( 'GB' ); /* $length = 22 */
$length = getAccountLength( 'CN' ); /* $length = 0 */

Return values

  • [int] - Expected length of the IBAN for the given country (in characters).
  • 0 - Otherwise.

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