Skip to content
/ IBAN Public
forked from RikudouSage/IBAN

PHP library for working with IBANs

License

Notifications You must be signed in to change notification settings

VladanZ/IBAN

 
 

Repository files navigation

IBAN library

Build Status Coverage Status Download

Installation

Via composer: composer require rikudou/iban

Usage

There are two validators and two iban implementations, one generic and one for Czech accounts.

Generic IBAN

<?php

use Rikudou\Iban\Iban\IBAN;

$iban = new IBAN('CZ5530300000001325090010');

echo $iban->asString(); // prints the iban
echo strval($iban); // the same as above

Generic IBAN validator

<?php

use Rikudou\Iban\Iban\IBAN;

$iban = new IBAN('CZ5530300000001325090010');

$validator = $iban->getValidator(); // returns instance of GenericIbanValidator

if(!$validator->isValid()) {
    // do something on invalid iban
}

Czech IBAN

Construct IBAN from Czech account number and bank code

<?php

use Rikudou\Iban\Iban\CzechIbanAdapter;

$iban = new CzechIbanAdapter('1325090010', '3030');

echo $iban->asString(); // prints CZ5530300000001325090010

Czech IBAN validator

<?php

use Rikudou\Iban\Iban\CzechIbanAdapter;

$iban = new CzechIbanAdapter('1325090010', '3030');

// returns an instance of CompoundValidator which contains
// CzechIbanValidator and GenericIbanValidator
$validator = $iban->getValidator();

if(!$validator->isValid()) {
    // do something
}

About

PHP library for working with IBANs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%