print "Is a SEPA member? "; if (iban_country_is_sepa($countrycode)) { print "Yes"; } else { print "No"; } print ".\n"; # get example iban $iban = $country['iban_example']; # output example iban properties one by one print "Example IBAN: " . iban_to_human_format($iban) . "\n"; print " - country " . iban_get_country_part($iban) . "\n"; print " - checksum " . iban_get_checksum_part($iban) . "\n"; print " - bban " . iban_get_bban_part($iban) . "\n"; print " - bank " . iban_get_bank_part($iban) . "\n"; print " - branch " . iban_get_branch_part($iban) . "\n"; print " - account " . iban_get_account_part($iban) . "\n"; # output all properties #$parts = iban_get_parts($iban); #print_r($parts); # verify print "\nChecking validity... "; if (verify_iban($iban)) { print "IBAN {$iban} is valid.\n"; } else { print "ERROR: IBAN {$iban} is invalid.\n"; $errors++; } print "\n"; } exit($errors);
public function Account() { return iban_get_account_part($this->iban); }
function iban_get_parts($iban) { return array('country' => iban_get_country_part($iban), 'checksum' => iban_get_checksum_part($iban), 'bban' => iban_get_bban_part($iban), 'bank' => iban_get_bank_part($iban), 'country' => iban_get_country_part($iban), 'branch' => iban_get_branch_part($iban), 'account' => iban_get_account_part($iban)); }
function _iban_nationalchecksum_implementation_nl($iban, $mode) { if ($mode != 'set' && $mode != 'find' && $mode != 'verify') { return ''; } # blank value on return to distinguish from correct execution $bank = iban_get_bank_part($iban); if (strtoupper($bank) == 'INGB') { return ''; } $account = iban_get_account_part($iban); $checksum = 0; for ($i = 0; $i < 10; $i++) { $checksum += (int) $account[$i] * (10 - $i); } $remainder = $checksum % 11; if ($mode == 'verify') { return $remainder == 0; # we return the result of mod11, if 0 it's good } elseif ($mode == 'set') { if ($remainder == 0) { return $iban; # we return as expected if the checksum is ok } return ''; # we return unimplemented if the checksum is bad } elseif ($mode == 'find') { return ''; # does not make sense for this 0-digit checksum } }