1. Go to this page and download the library: Download daycry/iban library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
daycry / iban example snippets
use Daycry\Iban\Iban;
use Daycry\Iban\Enums\IbanFormat;
$iban = new Iban(); // zero-config: Registry() + NullProvider() by default
$iban->isValid('ES91 2100 0418 4502 0005 1332'); // true
$result = $iban->validate('ES9121000418450200051332', checkNational: true);
$result->isValid(); // bool
$result->firstViolation(); // ?Violation
$parsed = $iban->parse('ES9121000418450200051332'); // throws InvalidIbanException if invalid
$parsed = $iban->tryParse('not an iban'); // null instead of throwing
$parsed->countryCode; // 'ES'
$parsed->bankIdentifier; // '2100'
$iban->format($parsed, IbanFormat::Print); // 'ES91 2100 0418 4502 0005 1332'
$iban->format($parsed, IbanFormat::Anonymized); // 'ES******************1332'
$bank = $iban->resolve($parsed);
$bank->isResolved(); // false — NullProvider never resolves
// BIC / SWIFT (ISO 9362) — no checksum, so "valid" = well-formed + recognised country
$iban->isValidBic('CAIXESBBXXX'); // true
$iban->parseBic('NWBKGB2L')->institutionCode; // 'NWBK'
$iban->validateIbanAndBic('GB29NWBK60161331926819', 'NWBKGB2L')->isValid(); // true (country + bank coherent)