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

isValidIBAN validates an IBAN by verifying its structure and check digits.

Usage

/* MySQL */
SELECT isValidIBAN( 'GB82WEST12345698765432' ); /* Returns 1 */
SELECT isValidIBAN( 'GB28WEST12345698765432' ); /* Returns 0 */
/* JavaScript */
var isValid = isValidIBAN( 'GB82WEST12345698765432' ); /* Returns 1 */
var isValid = isValidIBAN( 'GB28WEST12345698765432' ); /* Returns 0 */
/* PHP */
$isValid = isValidIBAN( 'GB82WEST12345698765432' ); /* Returns 1 */
$isValid = isValidIBAN( 'GB28WEST12345698765432' ); /* Returns 0 */

Return values

  • 1 - If specified IBAN is correct.
  • 0 - Otherwise.

Dependencies

In order to check that the first two digits of the SEPA account correspond to a SEPA country, this function uses the isSepaCountry function. In order to verify the length of the string, it uses getAccountLength. Finally, in order to verify the check digits, it uses getIBANCheckDigits.

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