PECL geoip >= 1.0.4
geoip_region_name_by_code - Returns the region name for some country and region code combo
Code Examples

geoip_region_name_by_code( string$country_code, string$region_code ): string

The geoip_region_name_by_code function will return the region name corresponding to a country and region code combo.

In the United States, the region code corresponds to the two-letter abbreviation of each state. In Canada, the region code corresponds to the two-letter province or territory code as attributed by Canada Post.

For the rest of the world, GeoIP uses FIPS 10-4 codes to represent regions. You can check for a detailed list of FIPS 10-4 codes.

This function is always available if using GeoIP Library version 1.4.1 or newer. The data is taken directly from the GeoIP Library and not from any database.



The two-letter country code (see geoip_country_code_by_name)


The two-letter (or digit) region code (see geoip_region_by_name)

Return Values

Returns the region name on success, or false if the country and region code combo cannot be found.

Example of geoip_region_name_by_code

Show all examples for geoip_region_name_by_code

PHP Version: