first import
[projectpier.git] / environment / classes / CountryCodes.class.php
blob638dce27f6ce36d3e9ec902fb569cf651a08b13b
1 <?php
3 /**
4 * Class that lists all available countries at the moment with their codes and english names
6 * @version 1.0
7 * @http://www.projectpier.org/
8 */
9 class CountryCodes {
11 /**
12 * Countries array
14 * @var array
16 static $countries = array(
17 'us' => 'United States',
18 'ca' => 'Canada',
19 'af' => 'Afghanistan',
20 'al' => 'Albania',
21 'dz' => 'Algeria',
22 'as' => 'American Samoa',
23 'ad' => 'Andorra',
24 'ao' => 'Angola',
25 'ai' => 'Anguilla',
26 'aq' => 'Antarctica',
27 'ag' => 'Antigua and Barbuda',
28 'ar' => 'Argentina',
29 'am' => 'Armenia',
30 'aw' => 'Aruba',
31 'au' => 'Australia',
32 'at' => 'Austria',
33 'az' => 'Azerbaijan',
34 'bs' => 'Bahamas',
35 'bh' => 'Bahrain',
36 'bd' => 'Bangladesh',
37 'bb' => 'Barbados',
38 'by' => 'Belarus',
39 'be' => 'Belgium',
40 'bz' => 'Belize',
41 'bj' => 'Benin',
42 'bm' => 'Bermuda',
43 'bt' => 'Bhutan',
44 'bo' => 'Bolivia',
45 'ba' => 'Bosnia and Herzegovina',
46 'bw' => 'Botswana',
47 'bv' => 'Bouvet Island',
48 'br' => 'Brazil',
49 'io' => 'British Indian Ocean Territory',
50 'vg' => 'British Virgin Islands',
51 'bn' => 'Brunei',
52 'bg' => 'Bulgaria',
53 'bf' => 'Burkina Faso',
54 'bi' => 'Burundi',
55 'kh' => 'Cambodia',
56 'cm' => 'Cameroon',
57 'cv' => 'Cape Verde',
58 'ky' => 'Cayman Islands',
59 'cf' => 'Central African Republic',
60 'td' => 'Chad',
61 'cl' => 'Chile',
62 'cn' => 'China',
63 'cx' => 'Christmas Island',
64 'cc' => 'Cocos Islands',
65 'co' => 'Colombia',
66 'km' => 'Comoros',
67 'cg' => 'Congo',
68 'ck' => 'Cook Islands',
69 'cr' => 'Costa Rica',
70 'hr' => 'Croatia',
71 'cu' => 'Cuba',
72 'cy' => 'Cyprus',
73 'cz' => 'Czech Republic',
74 'dk' => 'Denmark',
75 'dj' => 'Djibouti',
76 'dm' => 'Dominica',
77 'do' => 'Dominican Republic',
78 'tp' => 'East Timor',
79 'ec' => 'Ecuador',
80 'eg' => 'Egypt',
81 'sv' => 'El Salvador',
82 'gq' => 'Equatorial Guinea',
83 'er' => 'Eritrea',
84 'ee' => 'Estonia',
85 'et' => 'Ethiopia',
86 'fk' => 'Falkland Islands',
87 'fo' => 'Faroe Islands',
88 'fj' => 'Fiji',
89 'fi' => 'Finland',
90 'fr' => 'France',
91 'gf' => 'French Guiana',
92 'pf' => 'French Polynesia',
93 'tf' => 'French Southern Territories',
94 'ga' => 'Gabon',
95 'gm' => 'Gambia',
96 'ge' => 'Georgia',
97 'de' => 'Germany',
98 'gh' => 'Ghana',
99 'gi' => 'Gibraltar',
100 'gr' => 'Greece',
101 'gl' => 'Greenland',
102 'gd' => 'Grenada',
103 'gp' => 'Guadeloupe',
104 'gu' => 'Guam',
105 'gt' => 'Guatemala',
106 'gn' => 'Guinea',
107 'gw' => 'Guinea-Bissau',
108 'gy' => 'Guyana',
109 'ht' => 'Haiti',
110 'hm' => 'Heard and McDonald Islands',
111 'hn' => 'Honduras',
112 'hk' => 'Hong Kong',
113 'hu' => 'Hungary',
114 'is' => 'Iceland',
115 'in' => 'India',
116 'id' => 'Indonesia',
117 'ir' => 'Iran',
118 'iq' => 'Iraq',
119 'ie' => 'Ireland',
120 'il' => 'Israel',
121 'it' => 'Italy',
122 'ci' => 'Ivory Coast',
123 'jm' => 'Jamaica',
124 'jp' => 'Japan',
125 'jo' => 'Jordan',
126 'kz' => 'Kazakhstan',
127 'ke' => 'Kenya',
128 'ki' => 'Kiribati',
129 'kp' => 'North Korea',
130 'kr' => 'South Korea',
131 'kw' => 'Kuwait',
132 'kg' => 'Kyrgyzstan',
133 'la' => 'Laos',
134 'lv' => 'Latvia',
135 'lb' => 'Lebanon',
136 'ls' => 'Lesotho',
137 'lr' => 'Liberia',
138 'ly' => 'Libya',
139 'li' => 'Liechtenstein',
140 'lt' => 'Lithuania',
141 'lu' => 'Luxembourg',
142 'mo' => 'Macau',
143 'mk' => 'Macedonia',
144 'mg' => 'Madagascar',
145 'mw' => 'Malawi',
146 'my' => 'Malaysia',
147 'mv' => 'Maldives',
148 'ml' => 'Mali',
149 'mt' => 'Malta',
150 'mh' => 'Marshall Islands',
151 'mq' => 'Martinique',
152 'mr' => 'Mauritania',
153 'mu' => 'Mauritius',
154 'yt' => 'Mayotte',
155 'mx' => 'Mexico',
156 'fm' => 'Micronesia',
157 'md' => 'Moldova',
158 'mc' => 'Monaco',
159 'mn' => 'Mongolia',
160 'me' => 'Montenegro',
161 'ms' => 'Montserrat',
162 'ma' => 'Morocco',
163 'mz' => 'Mozambique',
164 'mm' => 'Myanmar',
165 'na' => 'Namibia',
166 'nr' => 'Nauru',
167 'np' => 'Nepal',
168 'nl' => 'Netherlands',
169 'an' => 'Netherlands Antilles',
170 'nc' => 'New Caledonia',
171 'nz' => 'New Zealand',
172 'ni' => 'Nicaragua',
173 'ne' => 'Niger',
174 'ng' => 'Nigeria',
175 'nu' => 'Niue',
176 'nf' => 'Norfolk Island',
177 'mp' => 'Northern Mariana Islands',
178 'no' => 'Norway',
179 'om' => 'Oman',
180 'pk' => 'Pakistan',
181 'pw' => 'Palau',
182 'pa' => 'Panama',
183 'pg' => 'Papua New Guinea',
184 'py' => 'Paraguay',
185 'pe' => 'Peru',
186 'ph' => 'Philippines',
187 'pn' => 'Pitcairn Island',
188 'pl' => 'Poland',
189 'pt' => 'Portugal',
190 'pr' => 'Puerto Rico',
191 'qa' => 'Qatar',
192 're' => 'Reunion',
193 'ro' => 'Romania',
194 'ru' => 'Russia',
195 'rw' => 'Rwanda',
196 'gs' => 'S. Georgia and S. Sandwich Isls.',
197 'kn' => 'Saint Kitts & Nevis',
198 'lc' => 'Saint Lucia',
199 'vc' => 'Saint Vincent and The Grenadines',
200 'ws' => 'Samoa',
201 'sm' => 'San Marino',
202 'st' => 'Sao Tome and Principe',
203 'sa' => 'Saudi Arabia',
204 'sn' => 'Senegal',
205 'rs' => 'Serbia',
206 'sc' => 'Seychelles',
207 'sl' => 'Sierra Leone',
208 'sg' => 'Singapore',
209 'sk' => 'Slovakia',
210 'si' => 'Slovenia',
211 'sp' => 'Solomon Islands',
212 'so' => 'Somalia',
213 'za' => 'South Africa',
214 'es' => 'Spain',
215 'lk' => 'Sri Lanka',
216 'sh' => 'St. Helena',
217 'pm' => 'St. Pierre and Miquelon',
218 'sd' => 'Sudan',
219 'sr' => 'Suriname',
220 'sj' => 'Svalbard and Jan Mayen Islands',
221 'sz' => 'Swaziland',
222 'se' => 'Sweden',
223 'ch' => 'Switzerland',
224 'sy' => 'Syria',
225 'tw' => 'Taiwan',
226 'tj' => 'Tajikistan',
227 'tz' => 'Tanzania',
228 'th' => 'Thailand',
229 'tg' => 'Togo',
230 'tk' => 'Tokelau',
231 'to' => 'Tonga',
232 'tt' => 'Trinidad and Tobago',
233 'tn' => 'Tunisia',
234 'tr' => 'Turkey',
235 'tm' => 'Turkmenistan',
236 'tc' => 'Turks and Caicos Islands',
237 'tv' => 'Tuvalu',
238 'um' => 'U.S. Minor Outlying Islands',
239 'ug' => 'Uganda',
240 'ua' => 'Ukraine',
241 'ae' => 'United Arab Emirates',
242 'uk' => 'United Kingdom',
243 'uy' => 'Uruguay',
244 'uz' => 'Uzbekistan',
245 'vu' => 'Vanuatu',
246 'va' => 'Vatican City',
247 've' => 'Venezuela',
248 'vn' => 'Vietnam',
249 'vi' => 'Virgin Islands',
250 'wf' => 'Wallis and Futuna Islands',
251 'eh' => 'Western Sahara',
252 'ye' => 'Yemen',
253 'zr' => 'Zaire',
254 'zm' => 'Zambia',
255 'zw' => 'Zimbabwe'
256 ); // array
259 * Return array of countries
261 * @access public
262 * @param void
263 * @return array
265 function getAll() {
266 return self::$countries;
267 } // getAll
270 * Find specific country by country code
272 * @access public
273 * @param string $code
274 * @return string
276 function getCountryNameByCode($code) {
277 return array_var(self::$countries, $code);
278 } // getCountryNameByCode
280 } // CountryCodes