File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,29 @@ You may convert codes between two-letter alpha2 and three-letter alpha3 codes::
179
179
180
180
$alpha2Code = Countries::getAlpha2Code($alpha3Code);
181
181
182
+ Numeric Country Codes
183
+ ~~~~~~~~~~~~~~~~~~~~~
184
+
185
+ The :class: `Symfony\\ Component\\ Intl\\ Countries ` class also provides access to the
186
+ numeric country codes according to the `ISO 3166-1 numeric `_ list::
187
+
188
+ use Symfony\Component\Intl\Countries;
189
+
190
+ \Locale::setDefault('en');
191
+
192
+ $numericCodes = Countries::getNumericCodes();
193
+ // ('alpha2Code' => 'numericCode')
194
+ // => ['AA' => '958', 'AD' => '020', ...]
195
+
196
+ $numericCode = Countries::getNumericCode('FR');
197
+ // => '250'
198
+
199
+ $alpha2 = Countries::getAlpha2FromNumeric('250');
200
+ // => 'FR'
201
+
202
+ $exists = Countries::numericCodeExists('250');
203
+ // => true
204
+
182
205
Locales
183
206
~~~~~~~
184
207
You can’t perform that action at this time.
0 commit comments