Skip to content

Commit c2453c3

Browse files
committed
Added new Region class to lookup for ISO 3166-2 subdivision code form country code and region name.
1 parent 7b60105 commit c2453c3

File tree

7 files changed

+3790
-113
lines changed

7 files changed

+3790
-113
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,17 @@ Below is the description of the functions available in the **Country** class.
9494
| Constructor | Expect a IP2Location Country Information CSV file. This database is free for download at https://www.ip2location.com/free/country-information |
9595
| **array** getCountryInfo($countryCode) | Provide a ISO 3166 country code to get the country information in array. Will return a full list of countries information if country code not provided. Below is the information returned: <ul><li>country_code</li><li>country_alpha3_code</li><li>country_numeric_code</li><li>capital</li><li>country_demonym</li><li>total_area</li><li>population</li><li>idd_code</li><li>currency_code</li><li>currency_name</li><li>currency_symbol</li><li>lang_code</li><li>lang_name</li><li>cctld</li></ul> |
9696

97+
### RegionClass
98+
99+
Below is the description of the functions available in the **Region** class.
100+
101+
| Function Name | Description |
102+
| --------------------------------------------------- | ------------------------------------------------------------ |
103+
| Constructor | Expect a IP2Location ISO 3166-2 Subdivision Code CSV file. This database is free for download at https://www.ip2location.com/free/iso3166-2 |
104+
| **string** getRegionCode($countryCode, $regionName) | Provide a ISO 3166 country code and the region name to get ISO 3166-2 subdivision code for the region. |
105+
106+
107+
97108
## DEPENDENCIES
98109

99110
This library requires IP2Location BIN data file to function. You may download the BIN data file at

data/IP2LOCATION-COUNTRY-INFORMATION-BASIC.CSV

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"BN","Bandar Seri Begawan","5765"
3030
"BO","Sucre","1098581"
3131
"BQ","Kralendijk","328"
32-
"BR","Brasileia","8514877"
32+
"BR","Brasilia","8514877"
3333
"BS","Nassau","13880"
3434
"BT","Thimphu","38394"
3535
"BV","-","49"

0 commit comments

Comments
 (0)