MistranscriptionSuggestions() public method

示例#1
0
# display registry contents
#print_r($_iban_registry);
# init
$errors = 0;
# Try to validate an invalid IBAN
$iban = "(@#(*@*ZV-This is NOT an IBAN!";
$myIban = new IBAN($iban);
if ($myIban->verify()) {
    print "ERROR: An invalid IBAN was validated!\n";
    $errors++;
}
print "Hooray! - Invalid IBAN successfully rejected.\n\n";
# Broken IIBAN
$broken_iiban = 'VG96VPVG00000L2345678901';
$myIban = new IBAN($broken_iiban);
$suggestions = $myIban->MistranscriptionSuggestions();
if (count($suggestions)) {
    print "Hooray!  Successfully derived '" . implode(',', $suggestions) . "' as likely transcription error source suggestion(s) for the incorrect IBAN {$broken_iiban}.\n";
} else {
    print "ERROR: Not able to ascertain suggested transcription error source(s) for {$broken_iiban}.\n";
    $errors++;
}
print "\n";
# Get list of countries
$countries = $myIban->Countries();
# Loop through the registry's examples, validating
foreach ($countries as $countrycode) {
    # instantiate
    $myCountry = new IBANCountry($countrycode);
    # start section
    print "[{$countrycode}: " . $myCountry->Name() . "]\n";