Test Failed
Branch master (42c96c)
by Joe
02:14
created
src/Validator.php 2 patches
Spacing   +255 added lines, -255 removed lines patch added patch discarded remove patch
@@ -33,276 +33,276 @@  discard block
 block discarded – undo
33 33
 	 *     @ - alpha a-zA-Z
34 34
 	 */
35 35
 	protected $formats = array(
36
-		'AD' => array('CC###'),		// Andorra, Notes: Each Parishes of Andorra|parish now has its own post code.
37
-		'AE' => array(),			// United Arab Emirates
38
-		'AF' => array('####'),		// Afghanistan, Notes: The first two digits (ranging from 10–43) correspond to the province, while the last two digits correspond either to the city/delivery zone (range 01–50) or to the district/delivery zone (range 51–99). (http://postalcode.afghanpost.gov.af/ Afghanistan Postal code lookup)
39
-		'AG' => array(),			// Antigua and Barbuda
40
-		'AI' => array('@I-2640'),		// Anguilla, Notes: Single code used for all addresses.
41
-		'AL' => array('####'),		// Albania, Notes: Introduced in 2006, gradually implemented throughout 2007.
42
-		'AM' => array('####'),		// Armenia, Notes: Previously used '''NNNNNN''' system inherited from former Soviet Union.
43
-		'AO' => array(),			// Angola
44
-		'AQ' => array('BIQQ 1ZZ'),		// British Antarctic Territory, Notes: One code for all addresses (AAAA NAA). UK territory, but not UK postcode.
45
-		'AR' => array('####', '@####@@@'),		// Argentina, Notes: 1974-1998 NNNN, and from 1999 ANNNNAAA. Codigo Postal Argentino (CPA), where the first A is the province code as in ISO 3166-2:AR, the four numbers are the old postal codes, the three last letters indicate a side of the block. Previously '''NNNN''' which is the minimum requirement as of 2006.
46
-		'AS' => array('#####', '#####-####'),		// American Samoa, Notes: U.S. ZIP codes (range '''96799''')
47
-		'AT' => array('####'),		// Austria, Notes: The first digit denotes regions, which are partly identical to one of the nine provinces—called ''Bundesländer''; the last the nearest post office in the area.
48
-		'AU' => array('####'),		// Australia, Notes: In general, the first digit identifies the state or territory.
49
-		'AW' => array(),			// Aruba
50
-		'AX' => array('#####', 'CC-#####'),		// Åland Islands, Notes: With Finland, first two numbers are 22. CC-NNNNN used from abroad
51
-		'AZ' => array('CC####'),		// Azerbaijan, Notes: Previously used '''NNNNNN''' system inherited from former Soviet Union.
52
-		'BA' => array('#####'),		// Bosnia and Herzegovina
53
-		'BB' => array('CC#####'),		// Barbados, Notes: Only one postal code currently assigned. '''11000''' applies to the General Post Office building in Cheapside, Bridgetown, to enable delivery to Barbados by global package delivery companies whose software requires a postal code.
54
-		'BD' => array('####'),		// | List of postal codes in Bangladesh|Bangladesh
55
-		'BE' => array('####'),		// Belgium, Notes: In general, the first digit gives the province.
56
-		'BF' => array(),			// Burkina Faso
57
-		'BG' => array('####'),		// Bulgaria
58
-		'BH' => array('###', '####'),		// Bahrain, Notes: Valid post code numbers are '''101''' to '''1216''' with gaps in the range. Known as ''block number'' ({{lang-ar|رقم المجمع}}) formally. The first digit in NNN format and the first two digits in NNNN format refer to one of the 12 municipalities of the country. PO Box address doesn't need a block number or city name, just the PO Box number followed by the name of the country, Bahrain.
59
-		'BI' => array(),			// Burundi
60
-		'BJ' => array(),			// Benin
61
-		'BL' => array('97133'),		// Saint Barthélemy, Notes: Overseas Collectivity of France. French codes used.
62
-		'BM' => array('@@ ##', '@@ @@'),		// Bermuda, Notes: AA NN for street addresses, AA AA for P.O. Box addresses. The second half of the postcode identifies the street delivery walk (e.g.: Hamilton HM 12) or the PO Box number range (e.g.: Hamilton HM BX).  See Postal codes in Bermuda.
63
-		'BN' => array('@@####'),		// Brunei
64
-		'BO' => array(),			// Bolivia
65
-		'BQ' => array(),			// Bonaire, Sint Eustatius and Saba
66
-		'BR' => array('#####-###'),		// Brazil, Notes: NNNNN only from 1971 to 1992. Código de Endereçamento Postal (CEP): -000 to -899 are used for streets, roads, avenues, boulevards; -900 to -959 are used for buildings with a high postal use; -960 to -969 are for promotional use; -970 to -989 are post offices and regular P.O. boxes; and -990 to -998 are used for community P.O. boxes. -999 is used for special services.
67
-		'BS' => array(),			// Bahamas
68
-		'BT' => array('#####'),		// Bhutan
69
-		'BV' => array(),			// Bouvet Island
70
-		'BW' => array(),			// Botswana
71
-		'BY' => array('######'),		// Belarus, Notes: Retained system inherited from former Soviet Union.
72
-		'BZ' => array(),			// Belize
73
-		'CA' => array('@#@ #@#'),		// Canada, Notes: The system was gradually introduced starting in April 1971 in Ottawa. The letters D, F, I, O, Q, and U are not used to avoid confusion with other letters or numbers.
74
-		'CC' => array('####'),		// Cocos (Keeling) Island, Notes: Part of the Australian postal code system.
75
-		'CD' => array(),			// Congo, Democratic Republic
76
-		'CF' => array(),			// Central African Republic
77
-		'CG' => array(),			// Congo (Brazzaville)
78
-		'CH' => array('####'),		// Switzerland, Notes: With Liechtenstein, ordered from west to east. In Geneva and other big cities, like Basel, Bern, Zurich, there may be one or two digits after the name of the city when the generic City code (1211) is used instead of the area-specific code (1201, 1202...), e.g.: 1211 Geneva 13. The digit identifies the post office. This addressing is generally used for P.O. box deliveries. Büsingen (Germany) and Campione (Italy) have also a Swiss postal code.
79
-		'CI' => array(),			// Côte d'Ivoire (Ivory Coast)
80
-		'CK' => array(),			// Cook Islands
81
-		'CL' => array('#######', '###-####'),		// Chile, Notes: May only be required for bulk mail.
82
-		'CM' => array(),			// Cameroon
83
-		'CN' => array('######'),		// China, Notes: A postal code or ''youbian'' (邮编) in a subordinate division will have the same first two digits as its governing one (see Administrative divisions of the People's Republic of China#Levels|Political divisions of China. The postal services in Macau or Hong Kong Special Administrative Region of the People's Republic of China|Special Administrative Regions remain separate from Mainland China, with no post code system currently used.
84
-		'CO' => array('######'),		// Colombia, Notes: First NN = 32 departments of Colombia|departments<ref>{{cite web|url=http://english.4-72.com.co/?q=content/postal-codes |title=Postal Codes |publisher=Colombian Postal Network 4-72 |accessdate=2010-03-04 }}</ref> [http://www.codigopostal4-72.com.co/codigosPostales/ Códigos Postales | 4-72]
85
-		'CR' => array('#####', '#####-####'),		// Costa Rica, Notes: Was NNNN until 2007. First codes the provinces, next two the canton, last two the district.
86
-		'CU' => array('#####'),		// Cuba, Notes: May only be required for bulk mail. The letters CP are frequently used before the postal code. This is not a country code, but an abbreviation for "codigo postal" or postal code.
87
-		'CV' => array('####'),		// Cape Verde, Notes: The first digit indicates the island.
88
-		'CW' => array(),			// Curaçao
89
-		'CX' => array('####'),		// Christmas Island, Notes: Part of the Australian postal code system.
90
-		'CY' => array('####'),		// Cyprus, Notes: The postal code system covers the whole island, but is not used on mail to Northern Cyprus. Northern Cyprus uses a 5-digit code commencing 99, introduced in 2013. For mail sent there from abroad, the line "Mersin 10" is written on the line above that containing the postal code, and the country name used is "Turkey".
91
-		'CZ' => array('### ##'),		// Czech Republic, Notes: With Slovak Republic, Poštovní směrovací číslo (PSČ) - postal routing number.
92
-		'DE' => array('#####'),		// Germany, Notes: Known as Postleitzahl (PLZ), introduced after the German reunification. Between 1989 and 1993 the old separate 4-digit postal codes of former West-Germany|West- and East-Germany were distinguished by preceding "W-" ('West') or "O-" ({{lang|de|'Ost'}} for East).
93
-		'DJ' => array(),			// Djibouti
94
-		'DK' => array('####'),		// Denmark, Notes: Numbering follows the dispatch of postal trains from Copenhagen.<ref>http://www.denstoredanske.dk/It,_teknik_og_naturvidenskab/Elektronik,_teletrafik_og_kommunikation/Postforsendelser/postnummer?highlight=postnummer</ref> Also used by Greenland, e.g.: Nuuk|DK-3900 Nuuk.
95
-		'DM' => array(),			// Dominica
96
-		'DO' => array('#####'),		// Dominican Republic
97
-		'DZ' => array('#####'),		// Algeria, Notes: First two as in ISO 3166-2:DZ
98
-		'EC' => array('######'),		// Ecuador
99
-		'EE' => array('#####'),		// Estonia
100
-		'EG' => array('#####'),		// Egypt
101
-		'EH' => array(),			// Western Sahara
102
-		'ER' => array(),			// Eritrea
103
-		'ES' => array('#####'),		// Spain, Notes: First two indicate the province, range 01-52
104
-		'ET' => array('####'),		// Ethiopia, Notes: The code is only used on a trial basis for Addis Ababa addresses.
105
-		'FI' => array('#####'),		// Finland, Notes: A lower first digit indicates a place in south (for example 00100 Helsinki), a higher indicates a place further to north (99800 in Ivalo). The last digit is usually 0, except for postal codes for PO Box number ranges, in which case it is 1. Country code for Finland: "FI". In the Åland Islands, the postal code is prefixed with "AX", not "FI". Some postal codes for rural settlements may end with 5, and there are some unique postal codes for large companies and institutions, e.g. 00014 HELSINGIN YLIOPISTO (university), 00102 EDUSKUNTA (parliament), 00020 NORDEA (a major Scandinavian bank).
106
-		'FJ' => array(),			// Fiji
107
-		'FK' => array('FIQQ 1ZZ'),		// Falkland Islands, Notes: Single code (AAAA NAA). UK territory, but not UK postcode
108
-		'FM' => array('#####', '#####-####'),		// Micronesia, Notes: U.S. ZIP codes. Range '''96941''' - '''96944'''.
109
-		'FO' => array('###'),		// Faroe Islands, Notes: Self-governing territory within the Kingdom of Denmark, but not Danish postcode.
110
-		'FR' => array('#####'),		// France, Notes: The first two digits give the ''département in France|département'' number, while in Paris, Lyon and Marseille, the last two digits of the postal code indicates the Municipal arrondissement in France|arrondissement. Both of the 2 Corsican départements use "20" as the first two digits. Also used by French overseas departments and territories. Monaco is also part of the French postal code system, but the country code MC- is used for Monegasque addresses.
111
-		'GA' => array(),			// Gabon
112
-		'GB' => array('@#', '@##', '@@#', '@@##', '@#@', '@@#@', '@@@', '@# #@@', '@## #@@', '@@# #@@', '@@## #@@', '@#@ #@@', '@@#@ #@@', '@@@ #@@'),		// | Postcodes in the United Kingdom|United Kingdom, Notes: Known as the UK postcodes|postcode. The first letter(s) indicate the List of postcode areas in the United Kingdom|postal area, such as the town or part of London. Placed on a separate line below the city (or county, if used). The UK postcode is made up of two parts separated by a space.  These are known as the '''outward postcode''' and the '''inward postcode'''. The outward postcode is always one of the following formats: AN, ANN, AAN, AANN, ANA, AANA, AAA.  The inward postcode is always formatted as NAA.  A valid inward postcode never contains the letters: C, I, K, M, O or V.  The British Forces Post Office has a different system, but as of 2012 has also adopted UK-style postcodes that begin with "BF1" for electronic compatibility.
113
-		'GD' => array(),			// Grenada
114
-		'GE' => array('####'),		// Georgia
115
-		'GF' => array('973##'),		// French Guiana, Notes: Overseas Department of France. French codes used. Range '''97300''' - '''97390'''.
116
-		'GG' => array('@@# #@@', '@@## #@@'),		// | GY postcode area|Guernsey, Notes: UK-format postcode (first two letters are always GY)
117
-		'GH' => array(),			// Ghana, Notes: {{citation needed|date=January 2011}}
118
-		'GI' => array('GX11 1@@'),		// Gibraltar, Notes: Single code used for all addresses.
119
-		'GL' => array('####'),		// Greenland, Notes: Part of the Danish postal code system.
120
-		'GM' => array(),			// Gambia
121
-		'GN' => array('###'),		// Guinea
122
-		'GP' => array('971##'),		// Guadeloupe, Notes: Overseas Department of France. French codes used. Range '''97100''' - '''97190'''.
123
-		'GQ' => array(),			// Equatorial Guinea
124
-		'GR' => array('### ##'),		// Greece
125
-		'GS' => array('SIQQ 1ZZ'),		// South Georgia and the South Sandwich Islands, Notes: One code for all addresses.
126
-		'GT' => array('#####'),		// Guatemala, Notes: The first two numbers identify the department, the third number the route and the last two the office.
127
-		'GU' => array('#####', '#####-####'),		// Guam, Notes: U.S. ZIP codes. Range '''96910''' - '''96932'''.
128
-		'GW' => array('####'),		// Guinea Bissau
129
-		'GY' => array(),			// Guyana
130
-		'HK' => array(),			// Hong Kong, Notes: [http://www.upu.int/fileadmin/documentsFiles/activities/addressingUnit/hkgEn.pdf] The dummy postal code of Hong Kong is 999077.
131
-		'HM' => array(),			// Heard and McDonald Islands
132
-		'HN' => array('CC#####'),		// Honduras
133
-		'HR' => array('#####'),		// Croatia
134
-		'HT' => array('####'),		// Haiti
135
-		'HU' => array('####'),		// Hungary, Notes: The code defines an area, usually one code per settlement except the six largest towns. One code can identify more (usually) small settlements as well.
136
-		'ID' => array('#####'),		// Indonesia, Notes: Kode Pos. Included East Timor (ranges 88xxx and 89xxx) until 1999, no longer used. For Indonesia postal code information visit [http://kodepos.posindonesia.co.id <nowiki>[2]</nowiki>]
137
-		'IE' => array('@## @#@#', '@## @@##', '@## @#@@', '@#W @#@#', '@#W @@##', '@#W @#@@'),		// Ireland, Notes: Ireland's postcode system (called Eircode) refers to individual properties - not to streets/areas. The first 3 characters are a routing key referring to an area's postal district, and the second 4 characters are an individual property identifier. "see www.eircode.ie for more information"'' See also Republic of Ireland postal addresses.''
138
-		'IL' => array('#######'),		// Israel, Notes: In 2013, after the introduction of the 7 digit codes, 5 digit codes were still being used widely.
139
-		'IM' => array('CC# #@@', 'CC## #@@'),		// | IM postcode area|Isle of Man, Notes: UK-format postcode. The first two letters are always IM.
140
-		'IN' => array('######', '## ###'),		// India
141
-		'IO' => array('BB#D 1ZZ'),		// British Indian Ocean Territory, Notes: One code for all addresses (AAAA NAA). UK territory, but not UK postcode.
142
-		'IQ' => array('#####'),		// Iraq
143
-		'IR' => array('##########'),		// Iran, Notes: (Persian language|Persian: کد پستی)
144
-		'IS' => array('###'),		// Iceland
145
-		'IT' => array('#####'),		// Italy, Notes: Codice di Avviamento Postale (CAP). Also used by San Marino and Vatican City. First two digits identify province with some exceptions, because there are more than 100 provinces.
146
-		'JE' => array('CC# #@@', 'CC## #@@'),		// | JE postcode area|Jersey, Notes: UK-format postcode. The first two letters are always JE.
147
-		'JM' => array('##'),		// Jamaica, Notes: Before suspension: CCAAANN. Jamaica currently has no national postal code system, except for Kingston and Lower St. Andrew, which are divided into postal districts numbered '''1'''-'''20'''<ref>[http://www.jamaicapost.gov.jm/corporate_news/pressrelease_07.htm Postal Corporation of Jamaica Press Releases 2007 - POST CODE PROJECT SUSPENDED INDEFINITELY (12 February 2007)]</ref>
148
-		'JO' => array('#####'),		// Jordan, Notes: Deliveries to PO Boxes only.
149
-		'JP' => array('###-####'),		// Japan, Notes: See also Japanese addressing system.
150
-		'KE' => array('#####'),		// Kenya, Notes: Deliveries to PO Boxes only. The postal code refers to the post office at which the receiver's P. O. Box is located.
151
-		'KG' => array('######'),		// Kyrgyzstan
152
-		'KH' => array('#####'),		// Cambodia
153
-		'KI' => array(),			// Kiribati
154
-		'KM' => array(),			// Comoros
155
-		'KN' => array(),			// Saint Kitts and Nevis
156
-		'KP' => array(),			// Korea, North
157
-		'KR' => array('#####'),		// | List of postal codes in South Korea|Korea, South, Notes: Previously NNN-NNN (1988~2015), NNN-NN (1970~1988)
158
-		'KW' => array('#####'),		// Kuwait, Notes: The first two digits represent the sector and the last three digits represents the post office.
159
-		'KY' => array('CC#-####'),		// Cayman Islands
160
-		'KZ' => array('######'),		// Kazakhstan, Notes: <ref>[http://eshop.kazpost.kz/QueryForm.php Kazakhstan's postal codes]</ref>
161
-		'LA' => array('#####'),		// Laos
162
-		'LB' => array('#####', '#### ####'),		// Lebanon, Notes: The first four digits represent the region or postal zone,the last four digits represent the building see also [http://postal-codes.net/lebanon_postal_codes/ Lebanon Postal code website].
163
-		'LC' => array('LC##  ###'),		// Saint Lucia, Notes: The first two letters are always LC. There are two spaces between the second and third digits.
164
-		'LI' => array('####'),		// Liechtenstein, Notes: With Switzerland, ordered from west to east. Range '''9485''' - '''9498'''.
165
-		'LK' => array('#####'),		// Sri Lanka, Notes: Reference: http://mohanjith.net/ZIPLook/ Incorporates Colombo postal districts, e.g.: Colombo 1 is "00100". You can search for specific postal codes [http://www.slpost.gov.lk here].
166
-		'LR' => array('####'),		// Liberia, Notes: Two digit postal zone after city name.
167
-		'LS' => array('###'),		// Lesotho
168
-		'LT' => array('CC-#####'),		// Lithuania, Notes: References: http://www.post.lt/en/help/postal-code-search. Previously '''9999''' which was actually the old Soviet Union|Soviet '''999999''' format code with the first 2 digits dropped.
169
-		'LU' => array('####'),		// Luxembourg, Notes: References: http://www.upu.int/post_code/en/countries/LUX.pdf
170
-		'LV' => array('CC-####'),		// Latvia
171
-		'LY' => array(),			// Libya
172
-		'MA' => array('#####'),		// Morocco
173
-		'MC' => array('980##'),		// Monaco, Notes: Uses the French Postal System, but with an "MC" Prefix for Monaco. Code range 98000-98099
174
-		'MD' => array('CC####', 'CC-####'),		// Moldova
175
-		'ME' => array('#####'),		// Montenegro
176
-		'MF' => array('97150'),		// Saint Martin, Notes: Overseas Collectivity of France. French codes used.
177
-		'MG' => array('###'),		// Madagascar
178
-		'MH' => array('#####', '#####-####'),		// Marshall Islands, Notes: U.S. ZIP codes. Range '''96960''' - '''96970'''.
179
-		'MK' => array('####'),		// Macedonia
180
-		'ML' => array(),			// Mali
181
-		'MM' => array('#####'),		// Myanmar
182
-		'MN' => array('######'),		// Mongolia, Notes: First digit: region / zone, Second digit: province / district, Last three digits: locality / delivery block<ref>http://en.youbianku.com/Mongolia</ref>
183
-		'MO' => array(),			// Macau, Notes: [http://www.upu.int/fileadmin/userUpload/damFileSystem/universalPostalUnion/activities/addressing/postalAddressingSystemsInMemberCountries/sheetsEn/MAC.pdf]<!-- Please DON'T add any post code information. ALL postcode sources are WRONG, and Macau doesn't use postcodes. See the addressing guide from Universal Postal Union (link above) BEFORE editing. -->
184
-		'MP' => array('#####', '#####-####'),		// Northern Mariana Islands, Notes: U.S. ZIP codes. Range '''96950''' - '''96952'''.
185
-		'MQ' => array('972##'),		// Martinique, Notes: Overseas Department of France. French codes used. Range '''97200''' - '''97290'''.
186
-		'MR' => array(),			// Mauritania
187
-		'MS' => array('MSR 1110-1350'),		// Montserrat
188
-		'MT' => array('@@@ ####'),		// Malta, Notes: Kodiċi Postali
189
-		'MU' => array('#####'),		// Mauritius
190
-		'MV' => array('#####'),		// Maldives
191
-		'MW' => array(),			// Malawi
192
-		'MX' => array('#####'),		// Mexico, Notes: The first two digits identify the States of Mexico|state (or a part thereof), except for Nos. 00 to 16, which indicate ''delegaciones'' (boroughs) of the Mexican Federal District|Federal District (Mexico City).
193
-		'MY' => array('#####'),		// Malaysia
194
-		'MZ' => array('####'),		// Mozambique
195
-		'NA' => array(),			// Namibia, Notes: Formerly used South African postal code ranges from 9000-9299.<ref name="panorama">[https://books.google.co.uk/books?id=rMtBAAAAYAAJ&dq=Post+Codes+introduced+in+South+Africa+in+1973&focus=searchwithinvolume&q=9000 ''South African Panorama'' – Volume 22), South African Information Service, 1977, page 9</ref>  Withdrawn from use after independence in 1990.<ref>[https://books.google.co.uk/books?id=1c63AAAAIAAJ&dq=Postal+codes+in+Namibia&focus=searchwithinvolume&q=%22postal+codes%22 ''The comprehensive handbook of the postmarks of German South West Africa, South West Africa, Namibia''), Ralph F. Putzel, R.F. Putzel, 1991, page 173</ref> A five-digit postal code system is under consideration.<ref>[http://www.upu.int/fileadmin/documentsFiles/activities/addressingUnit/namEn.pdf Namibia), Universal Postal Union, May 2014</ref>
196
-		'NC' => array('988##'),		// New Caledonia, Notes: Overseas Collectivity of France. French codes used. Range '''98800''' - '''98890'''.
197
-		'NE' => array('####'),		// Niger
198
-		'NF' => array('####'),		// Norfolk Island, Notes: Part of the Australian postal code system.
199
-		'NG' => array('######'),		// Nigeria
200
-		'NI' => array('#####'),		// Nicaragua
201
-		'NL' => array('#### @@'),		// Netherlands, Notes: The combination of the postal code and the house number gives a unique identifier of the address. The four numbers indicate an area, the two letters indicate a group of some 25 habitations, offices, factories or post office boxes.
202
-		'NO' => array('####'),		// Norway, Notes: From south to north
203
-		'NP' => array('#####'),		// | List of postal codes in Nepal|Nepal
204
-		'NR' => array(),			// Nauru
205
-		'NU' => array(),			// Niue
206
-		'NZ' => array('####'),		// New Zealand, Notes: Postcodes were originally intended for bulk mailing and were not needed for addressing individual items. However, new post codes for general use were phased in from June 2006 and came into force by July 2008.
207
-		'OM' => array('###'),		// Oman, Notes: Deliveries to P.O. Boxes only.
208
-		'PA' => array('####'),		// Panama
209
-		'PE' => array('#####', 'CC ####'),		// | List of postal codes in Peru|Peru
210
-		'PF' => array('987##'),		// French Polynesia, Notes: Overseas Collectivity of France. French codes used. Range '''98700''' - '''98790'''.
211
-		'PG' => array('###'),		// Papua New Guinea
212
-		'PH' => array('####'),		// Philippines
213
-		'PK' => array('#####'),		// | List of postal codes of Pakistan|Pakistan, Notes: [https://trackpost.org/ Pakistan postal codes list]
214
-		'PL' => array('##-###'),		// Poland
215
-		'PM' => array('97500'),		// Saint Pierre and Miquelon, Notes: Overseas Collectivity of France. French codes used.
216
-		'PN' => array('PCR# 1ZZ'),		// Pitcairn Islands, Notes: Single code used(AAAA NAA). UK territory, but not UK postcode
217
-		'PR' => array('#####', '#####-####'),		// Puerto Rico, Notes: U.S. ZIP codes. ZIP codes 006XX for NW PR, 007XX for SE PR, in which XX designates the town or post office and 009XX for the San Juan Metropolitan Area, in which XX designates the area or borough of San Juan. The last four digits identify an area within the post office. For example 00716-2604: 00716-for the east section of the city of Ponce and 2604 for Aceitillo St. in the neighborhood of Los Caobos. US Post office is changing the PR address format to the American one: 1234 No Name Avenue, San Juan, PR 00901.
218
-		'PS' => array('###'),		// Palestine, Notes: not yet implemented in practice. Codes '''100-899''' are in the Westbank, '''900-999''' in the Gaza Strip
219
-		'PT' => array('####-###', '####'),	// Portugal
220
-		'PW' => array('#####', '#####-####'),		// Palau, Notes: U.S. ZIP codes. All locations '''96940'''.
221
-		'PY' => array('####'),		// | List of postal codes of Paraguay|Paraguay
222
-		'QA' => array(),			// Qatar
223
-		'RE' => array('974##'),		// Réunion, Notes: Overseas Department of France. French codes used. Range '''97400''' - '''97490'''.
224
-		'RO' => array('######'),		// Romania, Notes: Previously '''99999''' in Bucharest and '''9999''' in rest of country.
225
-		'RS' => array('#####'),		// Serbia, Notes: Poštanski adresni kod (PAK)
226
-		'RU' => array('######'),		// Russia, Notes: Placed on a line of its own.
227
-		'RW' => array(),			// Rwanda
228
-		'SA' => array('#####-####', '#####'),		// Saudi Arabia, Notes: NNNNN for PO Boxes. NNNNN-NNNN for home delivery. A complete 13-digit code has 5-digit number representing region, sector, city, and zone; 4-digit X between 2000 and 5999; 4-digit Y between 6000 and 9999 [http://www.esri.com/news/arcnews/winter1011articles/saudi-arabia.html]. Digits of 5-digit code may represent postal region, sector, branch,  section, and block respectively [http://youbianku.com/files/upu/SAU.pdf].
229
-		'SB' => array(),			// Solomon Islands
230
-		'SC' => array(),			// Seychelles
231
-		'SD' => array('#####'),		// Sudan
232
-		'SE' => array('### ##'),		// Sweden, Notes: The lowest number is '''100 00''' and the highest number is '''984 99'''.
233
-		'SG' => array('######'),		// Singapore, Notes: Each building has its own unique postcode.
234
-		'SH' => array('@@@@ 1ZZ'),		// Saint Helena, Ascension and Tristan da Cunha, Notes: Part of UK system (AAAA NAA). Saint Helena, Ascension and Tristan da Cunha|Saint Helena uses one code STHL 1ZZ, Ascension Island|Ascension uses one code ASCN 1ZZ, Tristan da Cunha uses one code TDCU 1ZZ.
235
-		'SI' => array('####', 'CC-####'),		// Slovenia
236
-		'SJ' => array('####'),		// | Svalbard and Jan Mayen, Notes: Norway postal codes
237
-		'SK' => array('### ##'),		// Slovakia, Notes: with Czech Republic from west to east, Poštové smerovacie číslo (PSČ) - postal routing number.
238
-		'SL' => array(),			// Sierra Leone
239
-		'SM' => array('4789#'),		// San Marino, Notes: With Italy, uses a five-digit numeric CAP of Emilia Romagna. Range 47890 and 47899
240
-		'SN' => array('#####'),		// Senegal, Notes: The letters CP or C.P. are often written in front of the postcode. This is not a country code, but simply an abbreviation for "code postal".
241
-		'SO' => array('@@ #####'),		// Somalia, Notes: Two letter postal codes for each of the nation's 18 Administrative divisions of Somalia|administrative regions (e.g. AW for Awdal, BN for Banaadir, BR for Bari, Somalia|Bari and SL for Sool, Somalia|Sool).<ref name="Wsptsg">{{cite news|title=Weekly Statement: Progress of the Somali Government|url=http://diplomat.so/2014/10/11/weekly-statement-progress-of-the-somali-government-3/|accessdate=12 October 2014|agency=Diplomat News Network|date=11 October 2014}}</ref>
242
-		'SR' => array(),			// Suriname
243
-		'SS' => array(),			// South Sudan
244
-		'ST' => array(),			// Sao Tome and Principe
245
-		'SV' => array('####'),		// El Salvador
246
-		'SX' => array(),			// Sint Maarten
247
-		'SY' => array(),			// Syria, Notes: A 4-digit system has been announced. Status unknown.
248
-		'SZ' => array('@###'),		// Swaziland, Notes: The letter identifies one of the country's four districts.
249
-		'TC' => array('TKC@ 1ZZ'),		// Turks and Caicos Islands, Notes: Single code used for all addresses.
250
-		'TD' => array(),			// Chad
251
-		'TF' => array(),			// French Southern and Antarctic Territories, Notes: French codes in the '''98400''' range have been reserved.
252
-		'TG' => array(),			// Togo
253
-		'TH' => array('#####'),		// Thailand, Notes: The first two specify the province, numbers as in ISO 3166-2:TH, the third and fourth digits specify a district (amphoe)
254
-		'TJ' => array('######'),		// Tajikistan, Notes: Retained system from former Soviet Union.
255
-		'TK' => array(),			// Tokelau
256
-		'TL' => array(),			// East Timor, Notes: No postal code system in use since Indonesian withdrawal in 1999.
257
-		'TM' => array('######'),		// Turkmenistan, Notes: Retained system from former Soviet Union.
258
-		'TN' => array('####'),		// Tunisia
259
-		'TO' => array(),			// Tonga
260
-		'TR' => array('#####'),		// Turkey, Notes: First two digits are the city numbers.<ref>http://www.postakodumne.com | Posta Kodum Ne - Postal Code Reference for Turkey</ref>
261
-		'TT' => array('######'),		// Trinidad and Tobago, Notes: First two digits specify a postal district (one of 72), next two digits a carrier route, last two digits a building or zone along that route
262
-		'TV' => array(),			// Tuvalu
263
-		'TW' => array('###', '###-##'),		// Taiwan, Notes: The first three digits of the postal code are required; the last two digits are optional. Codes are known as ''youdi quhao'' (郵遞區號), and are also assigned to Senkaku Islands (''Diaoyutai''), though Japanese-administered,  the Pratas Islands and the Spratly Islands. See List of postal codes in Taiwan.
264
-		'TZ' => array('#####'),		// Tanzania
265
-		'UA' => array('#####'),		// Ukraine
266
-		'UG' => array(),			// Uganda
267
-		'UM' => array(),			// United States Minor Outlying Islands
268
-		'US' => array('#####', '#####-####'),		// | ZIP code|United States, Notes: Known as the ZIP Code with five digits '''99999*''' or the ZIP+4 Code with nine digits '''99999-9999*''' (while the minimum requirement is the first five digits, the U.S. Postal Service encourages everyone to use all nine). Also used by the former US Pacific Territories: Federated States of Micronesia; Palau; and the Marshall Islands, as well as in current US territories American Samoa, Guam, Northern Mariana Islands, Puerto Rico, and the United States Virgin Islands.  An individual delivery point may be represented as an 11-digit number, but these are usually represented by Intelligent Mail barcode or formerly POSTNET bar code.
269
-		'UY' => array('#####'),		// Uruguay
270
-		'UZ' => array('######'),		// Uzbekistan, Notes: [http://www.aci.uz/ru/online_services/postal_indexes/ Почтовые индексы]
271
-		'VA' => array('00120'),		// Vatican, Notes: Single code used for all addresses. Part of the Italian postal code system.
272
-		'VC' => array('CC####'),		// Saint Vincent and the Grenadines
273
-		'VE' => array('####', '####-@'),		// Venezuela
274
-		'VG' => array('CC####'),		// British Virgin Islands, Notes: Specifically, VG1110 through VG1160<ref>http://www.finance.gov.vg/AboutUs/Departments/BVIPostOffice.aspx</ref>
275
-		'VI' => array('#####', '#####-####'),		// U.S. Virgin Islands, Notes: U.S. ZIP codes. Range '''00801''' - '''00851'''.
276
-		'VN' => array('######'),		// Vietnam, Notes: First two indicate a provinces of Vietnam|province.
277
-		'VU' => array(),			// Vanuatu
278
-		'WF' => array('986##'),		// Wallis and Futuna, Notes: Overseas Collectivity of France. French codes used. Range '''98600''' - '''98690'''.
279
-		'WS' => array('CC####'),		// Samoa
280
-		'XK' => array('#####'),		// Kosovo, Notes: A separate postal code for Kosovo was introduced by the UNMIK postal administration in 2004. Serbian postcodes are still widely used in the Serbian enclaves. No country code has been assigned.
281
-		'YE' => array(),			// Yemen, Notes: System for Sana'a Governorate using geocoding "عنواني" based on the Postal addresses in the Republic of Ireland#OpenPostcode|OpenPostcode algorithm is inaugurated in 2014.<ref>http://www.althawranews.net/pdf/main/2014-01-02/02.pdf</ref>
282
-		'YT' => array('976##'),		// Mayotte, Notes: Overseas Department of France. French codes used. Range '''97600''' - '''97690'''.
283
-		'ZA' => array('####'),		// South Africa, Notes: Postal codes are allocated to individual Post Office branches, some have two codes to differentiate between P.O. Boxes and street delivery addresses. Included Namibia (ranges 9000-9299) until 1992, no longer used.
284
-		'ZM' => array('#####'),		// Zambia
285
-		'ZW' => array(),			// Zimbabwe, Notes: System is being planned.
36
+		'AD' => array('CC###'), // Andorra, Notes: Each Parishes of Andorra|parish now has its own post code.
37
+		'AE' => array(), // United Arab Emirates
38
+		'AF' => array('####'), // Afghanistan, Notes: The first two digits (ranging from 10–43) correspond to the province, while the last two digits correspond either to the city/delivery zone (range 01–50) or to the district/delivery zone (range 51–99). (http://postalcode.afghanpost.gov.af/ Afghanistan Postal code lookup)
39
+		'AG' => array(), // Antigua and Barbuda
40
+		'AI' => array('@I-2640'), // Anguilla, Notes: Single code used for all addresses.
41
+		'AL' => array('####'), // Albania, Notes: Introduced in 2006, gradually implemented throughout 2007.
42
+		'AM' => array('####'), // Armenia, Notes: Previously used '''NNNNNN''' system inherited from former Soviet Union.
43
+		'AO' => array(), // Angola
44
+		'AQ' => array('BIQQ 1ZZ'), // British Antarctic Territory, Notes: One code for all addresses (AAAA NAA). UK territory, but not UK postcode.
45
+		'AR' => array('####', '@####@@@'), // Argentina, Notes: 1974-1998 NNNN, and from 1999 ANNNNAAA. Codigo Postal Argentino (CPA), where the first A is the province code as in ISO 3166-2:AR, the four numbers are the old postal codes, the three last letters indicate a side of the block. Previously '''NNNN''' which is the minimum requirement as of 2006.
46
+		'AS' => array('#####', '#####-####'), // American Samoa, Notes: U.S. ZIP codes (range '''96799''')
47
+		'AT' => array('####'), // Austria, Notes: The first digit denotes regions, which are partly identical to one of the nine provinces—called ''Bundesländer''; the last the nearest post office in the area.
48
+		'AU' => array('####'), // Australia, Notes: In general, the first digit identifies the state or territory.
49
+		'AW' => array(), // Aruba
50
+		'AX' => array('#####', 'CC-#####'), // Åland Islands, Notes: With Finland, first two numbers are 22. CC-NNNNN used from abroad
51
+		'AZ' => array('CC####'), // Azerbaijan, Notes: Previously used '''NNNNNN''' system inherited from former Soviet Union.
52
+		'BA' => array('#####'), // Bosnia and Herzegovina
53
+		'BB' => array('CC#####'), // Barbados, Notes: Only one postal code currently assigned. '''11000''' applies to the General Post Office building in Cheapside, Bridgetown, to enable delivery to Barbados by global package delivery companies whose software requires a postal code.
54
+		'BD' => array('####'), // | List of postal codes in Bangladesh|Bangladesh
55
+		'BE' => array('####'), // Belgium, Notes: In general, the first digit gives the province.
56
+		'BF' => array(), // Burkina Faso
57
+		'BG' => array('####'), // Bulgaria
58
+		'BH' => array('###', '####'), // Bahrain, Notes: Valid post code numbers are '''101''' to '''1216''' with gaps in the range. Known as ''block number'' ({{lang-ar|رقم المجمع}}) formally. The first digit in NNN format and the first two digits in NNNN format refer to one of the 12 municipalities of the country. PO Box address doesn't need a block number or city name, just the PO Box number followed by the name of the country, Bahrain.
59
+		'BI' => array(), // Burundi
60
+		'BJ' => array(), // Benin
61
+		'BL' => array('97133'), // Saint Barthélemy, Notes: Overseas Collectivity of France. French codes used.
62
+		'BM' => array('@@ ##', '@@ @@'), // Bermuda, Notes: AA NN for street addresses, AA AA for P.O. Box addresses. The second half of the postcode identifies the street delivery walk (e.g.: Hamilton HM 12) or the PO Box number range (e.g.: Hamilton HM BX).  See Postal codes in Bermuda.
63
+		'BN' => array('@@####'), // Brunei
64
+		'BO' => array(), // Bolivia
65
+		'BQ' => array(), // Bonaire, Sint Eustatius and Saba
66
+		'BR' => array('#####-###'), // Brazil, Notes: NNNNN only from 1971 to 1992. Código de Endereçamento Postal (CEP): -000 to -899 are used for streets, roads, avenues, boulevards; -900 to -959 are used for buildings with a high postal use; -960 to -969 are for promotional use; -970 to -989 are post offices and regular P.O. boxes; and -990 to -998 are used for community P.O. boxes. -999 is used for special services.
67
+		'BS' => array(), // Bahamas
68
+		'BT' => array('#####'), // Bhutan
69
+		'BV' => array(), // Bouvet Island
70
+		'BW' => array(), // Botswana
71
+		'BY' => array('######'), // Belarus, Notes: Retained system inherited from former Soviet Union.
72
+		'BZ' => array(), // Belize
73
+		'CA' => array('@#@ #@#'), // Canada, Notes: The system was gradually introduced starting in April 1971 in Ottawa. The letters D, F, I, O, Q, and U are not used to avoid confusion with other letters or numbers.
74
+		'CC' => array('####'), // Cocos (Keeling) Island, Notes: Part of the Australian postal code system.
75
+		'CD' => array(), // Congo, Democratic Republic
76
+		'CF' => array(), // Central African Republic
77
+		'CG' => array(), // Congo (Brazzaville)
78
+		'CH' => array('####'), // Switzerland, Notes: With Liechtenstein, ordered from west to east. In Geneva and other big cities, like Basel, Bern, Zurich, there may be one or two digits after the name of the city when the generic City code (1211) is used instead of the area-specific code (1201, 1202...), e.g.: 1211 Geneva 13. The digit identifies the post office. This addressing is generally used for P.O. box deliveries. Büsingen (Germany) and Campione (Italy) have also a Swiss postal code.
79
+		'CI' => array(), // Côte d'Ivoire (Ivory Coast)
80
+		'CK' => array(), // Cook Islands
81
+		'CL' => array('#######', '###-####'), // Chile, Notes: May only be required for bulk mail.
82
+		'CM' => array(), // Cameroon
83
+		'CN' => array('######'), // China, Notes: A postal code or ''youbian'' (邮编) in a subordinate division will have the same first two digits as its governing one (see Administrative divisions of the People's Republic of China#Levels|Political divisions of China. The postal services in Macau or Hong Kong Special Administrative Region of the People's Republic of China|Special Administrative Regions remain separate from Mainland China, with no post code system currently used.
84
+		'CO' => array('######'), // Colombia, Notes: First NN = 32 departments of Colombia|departments<ref>{{cite web|url=http://english.4-72.com.co/?q=content/postal-codes |title=Postal Codes |publisher=Colombian Postal Network 4-72 |accessdate=2010-03-04 }}</ref> [http://www.codigopostal4-72.com.co/codigosPostales/ Códigos Postales | 4-72]
85
+		'CR' => array('#####', '#####-####'), // Costa Rica, Notes: Was NNNN until 2007. First codes the provinces, next two the canton, last two the district.
86
+		'CU' => array('#####'), // Cuba, Notes: May only be required for bulk mail. The letters CP are frequently used before the postal code. This is not a country code, but an abbreviation for "codigo postal" or postal code.
87
+		'CV' => array('####'), // Cape Verde, Notes: The first digit indicates the island.
88
+		'CW' => array(), // Curaçao
89
+		'CX' => array('####'), // Christmas Island, Notes: Part of the Australian postal code system.
90
+		'CY' => array('####'), // Cyprus, Notes: The postal code system covers the whole island, but is not used on mail to Northern Cyprus. Northern Cyprus uses a 5-digit code commencing 99, introduced in 2013. For mail sent there from abroad, the line "Mersin 10" is written on the line above that containing the postal code, and the country name used is "Turkey".
91
+		'CZ' => array('### ##'), // Czech Republic, Notes: With Slovak Republic, Poštovní směrovací číslo (PSČ) - postal routing number.
92
+		'DE' => array('#####'), // Germany, Notes: Known as Postleitzahl (PLZ), introduced after the German reunification. Between 1989 and 1993 the old separate 4-digit postal codes of former West-Germany|West- and East-Germany were distinguished by preceding "W-" ('West') or "O-" ({{lang|de|'Ost'}} for East).
93
+		'DJ' => array(), // Djibouti
94
+		'DK' => array('####'), // Denmark, Notes: Numbering follows the dispatch of postal trains from Copenhagen.<ref>http://www.denstoredanske.dk/It,_teknik_og_naturvidenskab/Elektronik,_teletrafik_og_kommunikation/Postforsendelser/postnummer?highlight=postnummer</ref> Also used by Greenland, e.g.: Nuuk|DK-3900 Nuuk.
95
+		'DM' => array(), // Dominica
96
+		'DO' => array('#####'), // Dominican Republic
97
+		'DZ' => array('#####'), // Algeria, Notes: First two as in ISO 3166-2:DZ
98
+		'EC' => array('######'), // Ecuador
99
+		'EE' => array('#####'), // Estonia
100
+		'EG' => array('#####'), // Egypt
101
+		'EH' => array(), // Western Sahara
102
+		'ER' => array(), // Eritrea
103
+		'ES' => array('#####'), // Spain, Notes: First two indicate the province, range 01-52
104
+		'ET' => array('####'), // Ethiopia, Notes: The code is only used on a trial basis for Addis Ababa addresses.
105
+		'FI' => array('#####'), // Finland, Notes: A lower first digit indicates a place in south (for example 00100 Helsinki), a higher indicates a place further to north (99800 in Ivalo). The last digit is usually 0, except for postal codes for PO Box number ranges, in which case it is 1. Country code for Finland: "FI". In the Åland Islands, the postal code is prefixed with "AX", not "FI". Some postal codes for rural settlements may end with 5, and there are some unique postal codes for large companies and institutions, e.g. 00014 HELSINGIN YLIOPISTO (university), 00102 EDUSKUNTA (parliament), 00020 NORDEA (a major Scandinavian bank).
106
+		'FJ' => array(), // Fiji
107
+		'FK' => array('FIQQ 1ZZ'), // Falkland Islands, Notes: Single code (AAAA NAA). UK territory, but not UK postcode
108
+		'FM' => array('#####', '#####-####'), // Micronesia, Notes: U.S. ZIP codes. Range '''96941''' - '''96944'''.
109
+		'FO' => array('###'), // Faroe Islands, Notes: Self-governing territory within the Kingdom of Denmark, but not Danish postcode.
110
+		'FR' => array('#####'), // France, Notes: The first two digits give the ''département in France|département'' number, while in Paris, Lyon and Marseille, the last two digits of the postal code indicates the Municipal arrondissement in France|arrondissement. Both of the 2 Corsican départements use "20" as the first two digits. Also used by French overseas departments and territories. Monaco is also part of the French postal code system, but the country code MC- is used for Monegasque addresses.
111
+		'GA' => array(), // Gabon
112
+		'GB' => array('@#', '@##', '@@#', '@@##', '@#@', '@@#@', '@@@', '@# #@@', '@## #@@', '@@# #@@', '@@## #@@', '@#@ #@@', '@@#@ #@@', '@@@ #@@'), // | Postcodes in the United Kingdom|United Kingdom, Notes: Known as the UK postcodes|postcode. The first letter(s) indicate the List of postcode areas in the United Kingdom|postal area, such as the town or part of London. Placed on a separate line below the city (or county, if used). The UK postcode is made up of two parts separated by a space.  These are known as the '''outward postcode''' and the '''inward postcode'''. The outward postcode is always one of the following formats: AN, ANN, AAN, AANN, ANA, AANA, AAA.  The inward postcode is always formatted as NAA.  A valid inward postcode never contains the letters: C, I, K, M, O or V.  The British Forces Post Office has a different system, but as of 2012 has also adopted UK-style postcodes that begin with "BF1" for electronic compatibility.
113
+		'GD' => array(), // Grenada
114
+		'GE' => array('####'), // Georgia
115
+		'GF' => array('973##'), // French Guiana, Notes: Overseas Department of France. French codes used. Range '''97300''' - '''97390'''.
116
+		'GG' => array('@@# #@@', '@@## #@@'), // | GY postcode area|Guernsey, Notes: UK-format postcode (first two letters are always GY)
117
+		'GH' => array(), // Ghana, Notes: {{citation needed|date=January 2011}}
118
+		'GI' => array('GX11 1@@'), // Gibraltar, Notes: Single code used for all addresses.
119
+		'GL' => array('####'), // Greenland, Notes: Part of the Danish postal code system.
120
+		'GM' => array(), // Gambia
121
+		'GN' => array('###'), // Guinea
122
+		'GP' => array('971##'), // Guadeloupe, Notes: Overseas Department of France. French codes used. Range '''97100''' - '''97190'''.
123
+		'GQ' => array(), // Equatorial Guinea
124
+		'GR' => array('### ##'), // Greece
125
+		'GS' => array('SIQQ 1ZZ'), // South Georgia and the South Sandwich Islands, Notes: One code for all addresses.
126
+		'GT' => array('#####'), // Guatemala, Notes: The first two numbers identify the department, the third number the route and the last two the office.
127
+		'GU' => array('#####', '#####-####'), // Guam, Notes: U.S. ZIP codes. Range '''96910''' - '''96932'''.
128
+		'GW' => array('####'), // Guinea Bissau
129
+		'GY' => array(), // Guyana
130
+		'HK' => array(), // Hong Kong, Notes: [http://www.upu.int/fileadmin/documentsFiles/activities/addressingUnit/hkgEn.pdf] The dummy postal code of Hong Kong is 999077.
131
+		'HM' => array(), // Heard and McDonald Islands
132
+		'HN' => array('CC#####'), // Honduras
133
+		'HR' => array('#####'), // Croatia
134
+		'HT' => array('####'), // Haiti
135
+		'HU' => array('####'), // Hungary, Notes: The code defines an area, usually one code per settlement except the six largest towns. One code can identify more (usually) small settlements as well.
136
+		'ID' => array('#####'), // Indonesia, Notes: Kode Pos. Included East Timor (ranges 88xxx and 89xxx) until 1999, no longer used. For Indonesia postal code information visit [http://kodepos.posindonesia.co.id <nowiki>[2]</nowiki>]
137
+		'IE' => array('@## @#@#', '@## @@##', '@## @#@@', '@#W @#@#', '@#W @@##', '@#W @#@@'), // Ireland, Notes: Ireland's postcode system (called Eircode) refers to individual properties - not to streets/areas. The first 3 characters are a routing key referring to an area's postal district, and the second 4 characters are an individual property identifier. "see www.eircode.ie for more information"'' See also Republic of Ireland postal addresses.''
138
+		'IL' => array('#######'), // Israel, Notes: In 2013, after the introduction of the 7 digit codes, 5 digit codes were still being used widely.
139
+		'IM' => array('CC# #@@', 'CC## #@@'), // | IM postcode area|Isle of Man, Notes: UK-format postcode. The first two letters are always IM.
140
+		'IN' => array('######', '## ###'), // India
141
+		'IO' => array('BB#D 1ZZ'), // British Indian Ocean Territory, Notes: One code for all addresses (AAAA NAA). UK territory, but not UK postcode.
142
+		'IQ' => array('#####'), // Iraq
143
+		'IR' => array('##########'), // Iran, Notes: (Persian language|Persian: کد پستی)
144
+		'IS' => array('###'), // Iceland
145
+		'IT' => array('#####'), // Italy, Notes: Codice di Avviamento Postale (CAP). Also used by San Marino and Vatican City. First two digits identify province with some exceptions, because there are more than 100 provinces.
146
+		'JE' => array('CC# #@@', 'CC## #@@'), // | JE postcode area|Jersey, Notes: UK-format postcode. The first two letters are always JE.
147
+		'JM' => array('##'), // Jamaica, Notes: Before suspension: CCAAANN. Jamaica currently has no national postal code system, except for Kingston and Lower St. Andrew, which are divided into postal districts numbered '''1'''-'''20'''<ref>[http://www.jamaicapost.gov.jm/corporate_news/pressrelease_07.htm Postal Corporation of Jamaica Press Releases 2007 - POST CODE PROJECT SUSPENDED INDEFINITELY (12 February 2007)]</ref>
148
+		'JO' => array('#####'), // Jordan, Notes: Deliveries to PO Boxes only.
149
+		'JP' => array('###-####'), // Japan, Notes: See also Japanese addressing system.
150
+		'KE' => array('#####'), // Kenya, Notes: Deliveries to PO Boxes only. The postal code refers to the post office at which the receiver's P. O. Box is located.
151
+		'KG' => array('######'), // Kyrgyzstan
152
+		'KH' => array('#####'), // Cambodia
153
+		'KI' => array(), // Kiribati
154
+		'KM' => array(), // Comoros
155
+		'KN' => array(), // Saint Kitts and Nevis
156
+		'KP' => array(), // Korea, North
157
+		'KR' => array('#####'), // | List of postal codes in South Korea|Korea, South, Notes: Previously NNN-NNN (1988~2015), NNN-NN (1970~1988)
158
+		'KW' => array('#####'), // Kuwait, Notes: The first two digits represent the sector and the last three digits represents the post office.
159
+		'KY' => array('CC#-####'), // Cayman Islands
160
+		'KZ' => array('######'), // Kazakhstan, Notes: <ref>[http://eshop.kazpost.kz/QueryForm.php Kazakhstan's postal codes]</ref>
161
+		'LA' => array('#####'), // Laos
162
+		'LB' => array('#####', '#### ####'), // Lebanon, Notes: The first four digits represent the region or postal zone,the last four digits represent the building see also [http://postal-codes.net/lebanon_postal_codes/ Lebanon Postal code website].
163
+		'LC' => array('LC##  ###'), // Saint Lucia, Notes: The first two letters are always LC. There are two spaces between the second and third digits.
164
+		'LI' => array('####'), // Liechtenstein, Notes: With Switzerland, ordered from west to east. Range '''9485''' - '''9498'''.
165
+		'LK' => array('#####'), // Sri Lanka, Notes: Reference: http://mohanjith.net/ZIPLook/ Incorporates Colombo postal districts, e.g.: Colombo 1 is "00100". You can search for specific postal codes [http://www.slpost.gov.lk here].
166
+		'LR' => array('####'), // Liberia, Notes: Two digit postal zone after city name.
167
+		'LS' => array('###'), // Lesotho
168
+		'LT' => array('CC-#####'), // Lithuania, Notes: References: http://www.post.lt/en/help/postal-code-search. Previously '''9999''' which was actually the old Soviet Union|Soviet '''999999''' format code with the first 2 digits dropped.
169
+		'LU' => array('####'), // Luxembourg, Notes: References: http://www.upu.int/post_code/en/countries/LUX.pdf
170
+		'LV' => array('CC-####'), // Latvia
171
+		'LY' => array(), // Libya
172
+		'MA' => array('#####'), // Morocco
173
+		'MC' => array('980##'), // Monaco, Notes: Uses the French Postal System, but with an "MC" Prefix for Monaco. Code range 98000-98099
174
+		'MD' => array('CC####', 'CC-####'), // Moldova
175
+		'ME' => array('#####'), // Montenegro
176
+		'MF' => array('97150'), // Saint Martin, Notes: Overseas Collectivity of France. French codes used.
177
+		'MG' => array('###'), // Madagascar
178
+		'MH' => array('#####', '#####-####'), // Marshall Islands, Notes: U.S. ZIP codes. Range '''96960''' - '''96970'''.
179
+		'MK' => array('####'), // Macedonia
180
+		'ML' => array(), // Mali
181
+		'MM' => array('#####'), // Myanmar
182
+		'MN' => array('######'), // Mongolia, Notes: First digit: region / zone, Second digit: province / district, Last three digits: locality / delivery block<ref>http://en.youbianku.com/Mongolia</ref>
183
+		'MO' => array(), // Macau, Notes: [http://www.upu.int/fileadmin/userUpload/damFileSystem/universalPostalUnion/activities/addressing/postalAddressingSystemsInMemberCountries/sheetsEn/MAC.pdf]<!-- Please DON'T add any post code information. ALL postcode sources are WRONG, and Macau doesn't use postcodes. See the addressing guide from Universal Postal Union (link above) BEFORE editing. -->
184
+		'MP' => array('#####', '#####-####'), // Northern Mariana Islands, Notes: U.S. ZIP codes. Range '''96950''' - '''96952'''.
185
+		'MQ' => array('972##'), // Martinique, Notes: Overseas Department of France. French codes used. Range '''97200''' - '''97290'''.
186
+		'MR' => array(), // Mauritania
187
+		'MS' => array('MSR 1110-1350'), // Montserrat
188
+		'MT' => array('@@@ ####'), // Malta, Notes: Kodiċi Postali
189
+		'MU' => array('#####'), // Mauritius
190
+		'MV' => array('#####'), // Maldives
191
+		'MW' => array(), // Malawi
192
+		'MX' => array('#####'), // Mexico, Notes: The first two digits identify the States of Mexico|state (or a part thereof), except for Nos. 00 to 16, which indicate ''delegaciones'' (boroughs) of the Mexican Federal District|Federal District (Mexico City).
193
+		'MY' => array('#####'), // Malaysia
194
+		'MZ' => array('####'), // Mozambique
195
+		'NA' => array(), // Namibia, Notes: Formerly used South African postal code ranges from 9000-9299.<ref name="panorama">[https://books.google.co.uk/books?id=rMtBAAAAYAAJ&dq=Post+Codes+introduced+in+South+Africa+in+1973&focus=searchwithinvolume&q=9000 ''South African Panorama'' – Volume 22), South African Information Service, 1977, page 9</ref>  Withdrawn from use after independence in 1990.<ref>[https://books.google.co.uk/books?id=1c63AAAAIAAJ&dq=Postal+codes+in+Namibia&focus=searchwithinvolume&q=%22postal+codes%22 ''The comprehensive handbook of the postmarks of German South West Africa, South West Africa, Namibia''), Ralph F. Putzel, R.F. Putzel, 1991, page 173</ref> A five-digit postal code system is under consideration.<ref>[http://www.upu.int/fileadmin/documentsFiles/activities/addressingUnit/namEn.pdf Namibia), Universal Postal Union, May 2014</ref>
196
+		'NC' => array('988##'), // New Caledonia, Notes: Overseas Collectivity of France. French codes used. Range '''98800''' - '''98890'''.
197
+		'NE' => array('####'), // Niger
198
+		'NF' => array('####'), // Norfolk Island, Notes: Part of the Australian postal code system.
199
+		'NG' => array('######'), // Nigeria
200
+		'NI' => array('#####'), // Nicaragua
201
+		'NL' => array('#### @@'), // Netherlands, Notes: The combination of the postal code and the house number gives a unique identifier of the address. The four numbers indicate an area, the two letters indicate a group of some 25 habitations, offices, factories or post office boxes.
202
+		'NO' => array('####'), // Norway, Notes: From south to north
203
+		'NP' => array('#####'), // | List of postal codes in Nepal|Nepal
204
+		'NR' => array(), // Nauru
205
+		'NU' => array(), // Niue
206
+		'NZ' => array('####'), // New Zealand, Notes: Postcodes were originally intended for bulk mailing and were not needed for addressing individual items. However, new post codes for general use were phased in from June 2006 and came into force by July 2008.
207
+		'OM' => array('###'), // Oman, Notes: Deliveries to P.O. Boxes only.
208
+		'PA' => array('####'), // Panama
209
+		'PE' => array('#####', 'CC ####'), // | List of postal codes in Peru|Peru
210
+		'PF' => array('987##'), // French Polynesia, Notes: Overseas Collectivity of France. French codes used. Range '''98700''' - '''98790'''.
211
+		'PG' => array('###'), // Papua New Guinea
212
+		'PH' => array('####'), // Philippines
213
+		'PK' => array('#####'), // | List of postal codes of Pakistan|Pakistan, Notes: [https://trackpost.org/ Pakistan postal codes list]
214
+		'PL' => array('##-###'), // Poland
215
+		'PM' => array('97500'), // Saint Pierre and Miquelon, Notes: Overseas Collectivity of France. French codes used.
216
+		'PN' => array('PCR# 1ZZ'), // Pitcairn Islands, Notes: Single code used(AAAA NAA). UK territory, but not UK postcode
217
+		'PR' => array('#####', '#####-####'), // Puerto Rico, Notes: U.S. ZIP codes. ZIP codes 006XX for NW PR, 007XX for SE PR, in which XX designates the town or post office and 009XX for the San Juan Metropolitan Area, in which XX designates the area or borough of San Juan. The last four digits identify an area within the post office. For example 00716-2604: 00716-for the east section of the city of Ponce and 2604 for Aceitillo St. in the neighborhood of Los Caobos. US Post office is changing the PR address format to the American one: 1234 No Name Avenue, San Juan, PR 00901.
218
+		'PS' => array('###'), // Palestine, Notes: not yet implemented in practice. Codes '''100-899''' are in the Westbank, '''900-999''' in the Gaza Strip
219
+		'PT' => array('####-###', '####'), // Portugal
220
+		'PW' => array('#####', '#####-####'), // Palau, Notes: U.S. ZIP codes. All locations '''96940'''.
221
+		'PY' => array('####'), // | List of postal codes of Paraguay|Paraguay
222
+		'QA' => array(), // Qatar
223
+		'RE' => array('974##'), // Réunion, Notes: Overseas Department of France. French codes used. Range '''97400''' - '''97490'''.
224
+		'RO' => array('######'), // Romania, Notes: Previously '''99999''' in Bucharest and '''9999''' in rest of country.
225
+		'RS' => array('#####'), // Serbia, Notes: Poštanski adresni kod (PAK)
226
+		'RU' => array('######'), // Russia, Notes: Placed on a line of its own.
227
+		'RW' => array(), // Rwanda
228
+		'SA' => array('#####-####', '#####'), // Saudi Arabia, Notes: NNNNN for PO Boxes. NNNNN-NNNN for home delivery. A complete 13-digit code has 5-digit number representing region, sector, city, and zone; 4-digit X between 2000 and 5999; 4-digit Y between 6000 and 9999 [http://www.esri.com/news/arcnews/winter1011articles/saudi-arabia.html]. Digits of 5-digit code may represent postal region, sector, branch,  section, and block respectively [http://youbianku.com/files/upu/SAU.pdf].
229
+		'SB' => array(), // Solomon Islands
230
+		'SC' => array(), // Seychelles
231
+		'SD' => array('#####'), // Sudan
232
+		'SE' => array('### ##'), // Sweden, Notes: The lowest number is '''100 00''' and the highest number is '''984 99'''.
233
+		'SG' => array('######'), // Singapore, Notes: Each building has its own unique postcode.
234
+		'SH' => array('@@@@ 1ZZ'), // Saint Helena, Ascension and Tristan da Cunha, Notes: Part of UK system (AAAA NAA). Saint Helena, Ascension and Tristan da Cunha|Saint Helena uses one code STHL 1ZZ, Ascension Island|Ascension uses one code ASCN 1ZZ, Tristan da Cunha uses one code TDCU 1ZZ.
235
+		'SI' => array('####', 'CC-####'), // Slovenia
236
+		'SJ' => array('####'), // | Svalbard and Jan Mayen, Notes: Norway postal codes
237
+		'SK' => array('### ##'), // Slovakia, Notes: with Czech Republic from west to east, Poštové smerovacie číslo (PSČ) - postal routing number.
238
+		'SL' => array(), // Sierra Leone
239
+		'SM' => array('4789#'), // San Marino, Notes: With Italy, uses a five-digit numeric CAP of Emilia Romagna. Range 47890 and 47899
240
+		'SN' => array('#####'), // Senegal, Notes: The letters CP or C.P. are often written in front of the postcode. This is not a country code, but simply an abbreviation for "code postal".
241
+		'SO' => array('@@ #####'), // Somalia, Notes: Two letter postal codes for each of the nation's 18 Administrative divisions of Somalia|administrative regions (e.g. AW for Awdal, BN for Banaadir, BR for Bari, Somalia|Bari and SL for Sool, Somalia|Sool).<ref name="Wsptsg">{{cite news|title=Weekly Statement: Progress of the Somali Government|url=http://diplomat.so/2014/10/11/weekly-statement-progress-of-the-somali-government-3/|accessdate=12 October 2014|agency=Diplomat News Network|date=11 October 2014}}</ref>
242
+		'SR' => array(), // Suriname
243
+		'SS' => array(), // South Sudan
244
+		'ST' => array(), // Sao Tome and Principe
245
+		'SV' => array('####'), // El Salvador
246
+		'SX' => array(), // Sint Maarten
247
+		'SY' => array(), // Syria, Notes: A 4-digit system has been announced. Status unknown.
248
+		'SZ' => array('@###'), // Swaziland, Notes: The letter identifies one of the country's four districts.
249
+		'TC' => array('TKC@ 1ZZ'), // Turks and Caicos Islands, Notes: Single code used for all addresses.
250
+		'TD' => array(), // Chad
251
+		'TF' => array(), // French Southern and Antarctic Territories, Notes: French codes in the '''98400''' range have been reserved.
252
+		'TG' => array(), // Togo
253
+		'TH' => array('#####'), // Thailand, Notes: The first two specify the province, numbers as in ISO 3166-2:TH, the third and fourth digits specify a district (amphoe)
254
+		'TJ' => array('######'), // Tajikistan, Notes: Retained system from former Soviet Union.
255
+		'TK' => array(), // Tokelau
256
+		'TL' => array(), // East Timor, Notes: No postal code system in use since Indonesian withdrawal in 1999.
257
+		'TM' => array('######'), // Turkmenistan, Notes: Retained system from former Soviet Union.
258
+		'TN' => array('####'), // Tunisia
259
+		'TO' => array(), // Tonga
260
+		'TR' => array('#####'), // Turkey, Notes: First two digits are the city numbers.<ref>http://www.postakodumne.com | Posta Kodum Ne - Postal Code Reference for Turkey</ref>
261
+		'TT' => array('######'), // Trinidad and Tobago, Notes: First two digits specify a postal district (one of 72), next two digits a carrier route, last two digits a building or zone along that route
262
+		'TV' => array(), // Tuvalu
263
+		'TW' => array('###', '###-##'), // Taiwan, Notes: The first three digits of the postal code are required; the last two digits are optional. Codes are known as ''youdi quhao'' (郵遞區號), and are also assigned to Senkaku Islands (''Diaoyutai''), though Japanese-administered,  the Pratas Islands and the Spratly Islands. See List of postal codes in Taiwan.
264
+		'TZ' => array('#####'), // Tanzania
265
+		'UA' => array('#####'), // Ukraine
266
+		'UG' => array(), // Uganda
267
+		'UM' => array(), // United States Minor Outlying Islands
268
+		'US' => array('#####', '#####-####'), // | ZIP code|United States, Notes: Known as the ZIP Code with five digits '''99999*''' or the ZIP+4 Code with nine digits '''99999-9999*''' (while the minimum requirement is the first five digits, the U.S. Postal Service encourages everyone to use all nine). Also used by the former US Pacific Territories: Federated States of Micronesia; Palau; and the Marshall Islands, as well as in current US territories American Samoa, Guam, Northern Mariana Islands, Puerto Rico, and the United States Virgin Islands.  An individual delivery point may be represented as an 11-digit number, but these are usually represented by Intelligent Mail barcode or formerly POSTNET bar code.
269
+		'UY' => array('#####'), // Uruguay
270
+		'UZ' => array('######'), // Uzbekistan, Notes: [http://www.aci.uz/ru/online_services/postal_indexes/ Почтовые индексы]
271
+		'VA' => array('00120'), // Vatican, Notes: Single code used for all addresses. Part of the Italian postal code system.
272
+		'VC' => array('CC####'), // Saint Vincent and the Grenadines
273
+		'VE' => array('####', '####-@'), // Venezuela
274
+		'VG' => array('CC####'), // British Virgin Islands, Notes: Specifically, VG1110 through VG1160<ref>http://www.finance.gov.vg/AboutUs/Departments/BVIPostOffice.aspx</ref>
275
+		'VI' => array('#####', '#####-####'), // U.S. Virgin Islands, Notes: U.S. ZIP codes. Range '''00801''' - '''00851'''.
276
+		'VN' => array('######'), // Vietnam, Notes: First two indicate a provinces of Vietnam|province.
277
+		'VU' => array(), // Vanuatu
278
+		'WF' => array('986##'), // Wallis and Futuna, Notes: Overseas Collectivity of France. French codes used. Range '''98600''' - '''98690'''.
279
+		'WS' => array('CC####'), // Samoa
280
+		'XK' => array('#####'), // Kosovo, Notes: A separate postal code for Kosovo was introduced by the UNMIK postal administration in 2004. Serbian postcodes are still widely used in the Serbian enclaves. No country code has been assigned.
281
+		'YE' => array(), // Yemen, Notes: System for Sana'a Governorate using geocoding "عنواني" based on the Postal addresses in the Republic of Ireland#OpenPostcode|OpenPostcode algorithm is inaugurated in 2014.<ref>http://www.althawranews.net/pdf/main/2014-01-02/02.pdf</ref>
282
+		'YT' => array('976##'), // Mayotte, Notes: Overseas Department of France. French codes used. Range '''97600''' - '''97690'''.
283
+		'ZA' => array('####'), // South Africa, Notes: Postal codes are allocated to individual Post Office branches, some have two codes to differentiate between P.O. Boxes and street delivery addresses. Included Namibia (ranges 9000-9299) until 1992, no longer used.
284
+		'ZM' => array('#####'), // Zambia
285
+		'ZW' => array(), // Zimbabwe, Notes: System is being planned.
286 286
 	);
287 287
 
288 288
 	public function isValid($countryCode, $postalCode, $ignoreSpaces = false)
289 289
 	{
290 290
 		//$postalCode = str_replace('-', '', $postalCode);
291
-		if(!isset($this->formats[$countryCode]))
291
+		if (!isset($this->formats[$countryCode]))
292 292
 		{
293 293
 			throw new ValidationException(sprintf('Invalid country code: "%s"', $countryCode));
294 294
 		}
295 295
 
296
-		foreach($this->formats[$countryCode] as $format)
296
+		foreach ($this->formats[$countryCode] as $format)
297 297
 		{
298 298
 			#echo $postalCode . ' - ' . $this->getFormatPattern($format)."\n";
299
-			if(preg_match($this->getFormatPattern($format, $ignoreSpaces), $postalCode))
299
+			if (preg_match($this->getFormatPattern($format, $ignoreSpaces), $postalCode))
300 300
 			{
301 301
 				return true;
302 302
 			}
303 303
 		}
304 304
 
305
-		if(!count($this->formats[$countryCode]))
305
+		if (!count($this->formats[$countryCode]))
306 306
 		{
307 307
 			return true;
308 308
 		}
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 
313 313
 	public function getFormats($countryCode)
314 314
 	{
315
-		if(!isset($this->formats[$countryCode]))
315
+		if (!isset($this->formats[$countryCode]))
316 316
 		{
317 317
 			throw new ValidationException(sprintf('Invalid country code: "%s"', $countryCode));
318 318
 		}
Please login to merge, or discard this patch.
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@  discard block
 block discarded – undo
12 12
  *
13 13
  * @author Joe Huss <[email protected]>
14 14
  */
15
-class Validator
16
-{
15
+class Validator {
17 16
 	protected $zip_names = array(
18 17
 		'BR' => array('name' => 'CEP', 'acronym_text' => 'Código de endereçamento postal (Postal Addressing Code)'),
19 18
 		'CA' => array('name' => 'Postal Code', 'acronym_text' => ''),
@@ -285,54 +284,44 @@  discard block
 block discarded – undo
285 284
 		'ZW' => array(),			// Zimbabwe, Notes: System is being planned.
286 285
 	);
287 286
 
288
-	public function isValid($countryCode, $postalCode, $ignoreSpaces = false)
289
-	{
287
+	public function isValid($countryCode, $postalCode, $ignoreSpaces = false) {
290 288
 		//$postalCode = str_replace('-', '', $postalCode);
291
-		if(!isset($this->formats[$countryCode]))
292
-		{
289
+		if(!isset($this->formats[$countryCode])) {
293 290
 			throw new ValidationException(sprintf('Invalid country code: "%s"', $countryCode));
294 291
 		}
295 292
 
296
-		foreach($this->formats[$countryCode] as $format)
297
-		{
293
+		foreach($this->formats[$countryCode] as $format) {
298 294
 			#echo $postalCode . ' - ' . $this->getFormatPattern($format)."\n";
299
-			if(preg_match($this->getFormatPattern($format, $ignoreSpaces), $postalCode))
300
-			{
295
+			if(preg_match($this->getFormatPattern($format, $ignoreSpaces), $postalCode)) {
301 296
 				return true;
302 297
 			}
303 298
 		}
304 299
 
305
-		if(!count($this->formats[$countryCode]))
306
-		{
300
+		if(!count($this->formats[$countryCode])) {
307 301
 			return true;
308 302
 		}
309 303
 
310 304
 		return false;
311 305
 	}
312 306
 
313
-	public function getFormats($countryCode)
314
-	{
315
-		if(!isset($this->formats[$countryCode]))
316
-		{
307
+	public function getFormats($countryCode) {
308
+		if(!isset($this->formats[$countryCode])) {
317 309
 			throw new ValidationException(sprintf('Invalid country code: "%s"', $countryCode));
318 310
 		}
319 311
 
320 312
 		return $this->formats[$countryCode];
321 313
 	}
322 314
 
323
-	public function hasCountry($countryCode)
324
-	{
315
+	public function hasCountry($countryCode) {
325 316
 		return (isset($this->formats[$countryCode]));
326 317
 	}
327 318
 
328
-	protected function getFormatPattern($format, $ignoreSpaces = false)
329
-	{
319
+	protected function getFormatPattern($format, $ignoreSpaces = false) {
330 320
 		//$format = str_replace('-', '', $format);
331 321
 		$pattern = str_replace('#', '\d', $format);
332 322
 		$pattern = str_replace('@', '[a-zA-Z]', $pattern);
333 323
 
334
-		if ($ignoreSpaces)
335
-		{
324
+		if ($ignoreSpaces) {
336 325
 			$pattern = str_replace(' ', ' ?', $pattern);
337 326
 		}
338 327
 
Please login to merge, or discard this patch.
bin/parse.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 $page = str_replace("\n\n", "\n", $page);
28 28
 $lines = explode("\n", $page);
29 29
 $found = [];
30
-for($x = 0; $x < sizeof($lines); $x++) {
30
+for ($x = 0; $x < sizeof($lines); $x++) {
31 31
 	$line = $lines[$x];
32 32
 	if ((trim($line) == '|-' || trim($line) == '|-.') && mb_substr($lines[$x + 1], 0, 1) != '!') {
33 33
 		$x++;
@@ -45,13 +45,13 @@  discard block
 block discarded – undo
45 45
 		$area = explode(',', $area);
46 46
 		foreach ($area as $each_area)
47 47
 			if (trim($each_area) != '' && trim($each_area) != '- no codes -')
48
-				$codes[] = "'".trim($each_area)."'";
48
+				$codes[] = "'" . trim($each_area) . "'";
49 49
 		$street = explode(',', $street);
50 50
 		foreach ($street as $each_street)
51 51
 			if (trim($each_street) != '')
52
-				$codes[] = "'".trim($each_street)."'";
52
+				$codes[] = "'" . trim($each_street) . "'";
53 53
 		$found[] = $iso;
54
-		echo "		'$iso' => [" . str_replace(['N','A'], ['#', '@'], implode(", ", $codes)) . "]," . (sizeof($codes) == 0 ? '	' : '') . "		// $country" . (trim($notes) != '' ? ', Notes: '.$notes :  '') . "\n";
54
+		echo "		'$iso' => [" . str_replace(['N', 'A'], ['#', '@'], implode(", ", $codes)) . "]," . (sizeof($codes) == 0 ? '	' : '') . "		// $country" . (trim($notes) != '' ? ', Notes: ' . $notes : '') . "\n";
55 55
 	}
56 56
 }
57 57
 $db = $GLOBALS['tf']->db;
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
 	$area = explode(',', $area);
76 76
 	foreach ($area as $each_area)
77 77
 		if (trim($each_area) != '' && trim($each_area) != '- no codes -')
78
-			$codes[] = "'".trim($each_area)."'";
78
+			$codes[] = "'" . trim($each_area) . "'";
79 79
 	$street = explode(',', $street);
80 80
 	foreach ($street as $each_street)
81 81
 		if (trim($each_street) != '')
82
-			$codes[] = "'".trim($each_street)."'";
83
-	echo "		'$iso' => [" . implode(", ", $codes) . "]	// $country" . (trim($notes) != '' ? ', Notes: '.$notes :  '') . "\n";
82
+			$codes[] = "'" . trim($each_street) . "'";
83
+	echo "		'$iso' => [" . implode(", ", $codes) . "]	// $country" . (trim($notes) != '' ? ', Notes: ' . $notes : '') . "\n";
84 84
 }
85 85
 //$page = getcurlpage('https://en.wikipedia.org/wiki/List_of_postal_codes');
86 86
 //function_requirements('xml2array');
Please login to merge, or discard this patch.