forked from globalcitizen/php-iban
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Based on globalcitizen#126
- Loading branch information
Showing
1 changed file
with
15 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
<?php | ||
require_once dirname(__DIR__) . '/php-iban.php'; | ||
|
||
$dir = dirname(__FILE__); | ||
$ibans = `cat $dir/example-ibans/*`; | ||
$lines = explode("\n", $ibans); | ||
foreach ($lines as $iban) { | ||
$example_iban_files = glob(__DIR__ . '/example-ibans/*'); | ||
if (count($example_iban_files) == 0) { | ||
echo 'No example IBAN files found in "' . __DIR__ . '/example-ibans"' . "\n"; | ||
exit(1); | ||
} | ||
|
||
$ibans = []; | ||
foreach ($example_iban_files as $file) { | ||
if (is_readable($file)) { | ||
$ibans += file($file); | ||
} | ||
} | ||
foreach($ibans as $iban) { | ||
$iban = iban_to_machine_format($iban); | ||
print iban_to_human_format($iban) . "\n"; | ||
print iban_to_obfuscated_format($iban) . "\n"; | ||
echo iban_to_human_format($iban) . "\n"; | ||
echo iban_to_obfuscated_format($iban) . "\n"; | ||
} |