Last active
September 21, 2018 15:10
-
-
Save marlenesco/30150259c37021b35ae1aac7ee4f6dce to your computer and use it in GitHub Desktop.
ZipCode pattern generator
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
<?php | |
$patterns = []; | |
$data = json_decode(file_get_contents('http://i18napis.appspot.com/address/data'), true); | |
$countries = explode('~', $data['countries']); | |
foreach ($countries as $country) { | |
$data = json_decode(file_get_contents('http://i18napis.appspot.com/address/data/'.$country), true); | |
if (isset($data['zip'])) { | |
$patterns[$country] = $data['zip']; | |
} | |
} | |
var_export($patterns); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment