API reference / Quittio \ Core \ Validation \ Plausibility
Iban
final class in quittio/core
Quittio\Core\Validation\Plausibility\Iban · Source
IBAN check digit validation (ISO 13616, mod 97-10) without extensions.
Methods#
| Method | Description |
|---|---|
::isValid() | Whether the IBAN, after normalize(), has the IBAN structure (country code, two check digits, 11 to 30 alphanumeric characters) and correct check digits (mod 97 = 1). The country specific length is not checked. |
::mod97() | Remainder of a number given as alphanumeric string (A = 10 … Z = 35) divided by 97. |
::normalize() | Removes all whitespace and upper-cases the IBAN, e.g. "de02 1203 0000" becomes "DE021203000". |
isValid()#
public static function isValid(string $iban): boolWhether the IBAN, after normalize(), has the IBAN structure (country code, two check digits, 11 to 30 alphanumeric characters) and correct check digits (mod 97 = 1). The country specific length is not checked.
| Parameter | Type | Description |
|---|---|---|
$iban | string |
- Returns
bool
mod97()#
public static function mod97(string $value): intRemainder of a number given as alphanumeric string (A = 10 … Z = 35) divided by 97.
| Parameter | Type | Description |
|---|---|---|
$value | string |
- Returns
int
normalize()#
public static function normalize(string $iban): stringRemoves all whitespace and upper-cases the IBAN, e.g. "de02 1203 0000" becomes "DE021203000".
| Parameter | Type | Description |
|---|---|---|
$iban | string |
- Returns
string