# Loop through the registry's examples, validating foreach ($countries as $countrycode) { # instantiate $myCountry = new IBANCountry($countrycode); # start section print "[{$countrycode}: " . $myCountry->Name() . "]\n"; # output remaining country properties print "Is a SEPA member? "; if ($myCountry->IsSEPA()) { print "Yes"; } else { print "No"; } print ".\n"; # get example iban $myIban = new IBAN($myCountry->IBANExample()); # output example iban properties one by one print "Example IBAN: " . $myIban->HumanFormat() . "\n"; print " - country " . $myIban->Country() . "\n"; print " - checksum " . $myIban->Checksum() . "\n"; print " - bban " . $myIban->BBAN() . "\n"; print " - bank " . $myIban->Bank() . "\n"; print " - branch " . $myIban->Branch() . "\n"; print " - account " . $myIban->Account() . "\n"; # output all properties #$parts = $myIban->Parts(); #print_r($parts); # verify print "\nChecking validity... "; if ($myIban->Verify()) { print "IBAN {$myIban->iban} is valid.\n";
if ($parent_registrar != '') { print "No (outsources to the wise experts of '" . $parent_registrar . "')\n"; } else { print "Yes.\n"; } # official currency print "Official currency: "; $official_currency = $myCountry->CurrencyISO4217(); if ($official_currency == '') { print "None."; } else { print $official_currency; } print "\n"; # get example iban $myIban = new IBAN($myCountry->IBANExample()); # output example iban properties one by one print "Example IBAN: " . $myIban->HumanFormat() . "\n"; print " - country " . $myIban->Country() . "\n"; print " - checksum " . $myIban->Checksum() . "\n"; print " - bban " . $myIban->BBAN() . "\n"; print " - bank " . $myIban->Bank() . "\n"; print " - branch " . $myIban->Branch() . "\n"; print " - account " . $myIban->Account() . "\n"; $nationalchecksum = $myIban->NationalChecksum(); print " - natcksum " . $nationalchecksum . "\n"; # if a national checksum was present, validate it $supposed_checksum = $myIban->FindNationalChecksum(); if ($supposed_checksum != '') { if ($supposed_checksum != $nationalchecksum) { print " (INVALID! Should be '" . $supposed_checksum . "'!)\n";