Skip to content

Commit

Permalink
Added new Region class to lookup for ISO 3166-2 subdivision code form…
Browse files Browse the repository at this point in the history
… country code and region name.
  • Loading branch information
ip2location committed Aug 25, 2022
1 parent 7b60105 commit c2453c3
Show file tree
Hide file tree
Showing 7 changed files with 3,790 additions and 113 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ Below is the description of the functions available in the **Country** class.
| Constructor | Expect a IP2Location Country Information CSV file. This database is free for download at https://www.ip2location.com/free/country-information |
| **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> |

### RegionClass

Below is the description of the functions available in the **Region** class.

| Function Name | Description |
| --------------------------------------------------- | ------------------------------------------------------------ |
| 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 |
| **string** getRegionCode($countryCode, $regionName) | Provide a ISO 3166 country code and the region name to get ISO 3166-2 subdivision code for the region. |



## DEPENDENCIES

This library requires IP2Location BIN data file to function. You may download the BIN data file at
Expand Down
2 changes: 1 addition & 1 deletion data/IP2LOCATION-COUNTRY-INFORMATION-BASIC.CSV
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"BN","Bandar Seri Begawan","5765"
"BO","Sucre","1098581"
"BQ","Kralendijk","328"
"BR","Brasileia","8514877"
"BR","Brasilia","8514877"
"BS","Nassau","13880"
"BT","Thimphu","38394"
"BV","-","49"
Expand Down
Loading

0 comments on commit c2453c3

Please sign in to comment.