PHP code example of tenolo / bank-account
1. Go to this page and download the library: Download tenolo/bank-account 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/ */
tenolo / bank-account example snippets
use Tenolo\BankAccount\IBAN;
$iban = new IBAN::create('DE57 3704 0044 0532 0130 00');
// Prüft ob Ländercode, Länge und Prüfsumme der IBAN valide sind.
// Ist die IBAN nicht valide, gibt die getValidationErrors() Funktion
// die entsprechenden Fehlermeldungen als array zurück.
if (!$iban->isValid()) {
foreach($iban->getValidationErrors() as $error) {
echo $error;
}
}
// Gibt die "maschinenlesbare" IBAN zurück.
$iban->getIban(); // "DE57370400440532013000"
// Gibt die formatierte/normalisierte IBAN zurück.
$iban->getIban(true); // "DE57 3704 0044 0532 0130 00"
// Gibt den 2-stelligen Alpha-Ländercode der IBAN zurück.
$iban->getCountryCode(); // "DE"
// Gibt den 4-stelligen numerischen Ländercode der IBAN zurück.
$iban->getNumericCountryCode(); // "1314"
// Gibt die 2-stellige numerische Prüfziffer der IBAN zurück
$iban->getCheckDigits(); // "57"
// Gibt die Bankleitzahl (entsprechend dem Länder-Bankleitzahlenverzeichnis) zurück.
$iban->getBankIdentifier(); // "37040044"
// Gibt die Kunden-Kontonummer (ggf. mit vorangestellten Nullen) zurück.
$iban->getAccountNumber(); // "0532013000"