IBANExample() public method

public IBANExample ( )
コード例 #1
0
ファイル: ootest.php プロジェクト: gitter-badger/php-iban
# 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";
コード例 #2
0
ファイル: ootest.php プロジェクト: globalcitizen/php-iban
 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";