Get country by PHP

A simple PHP function is included in all webhosting packages. Here you see all variables:

  • 2 letter country code: geoip_country_code_by_name(IP) | Output: US
  • Full country name: geoip_country_name_by_name(IP) | Output: United States
  • 3 letter country code: geoip_country_code3_by_name(IP) | Output: USA
  • 2 letter continent code: geoip_continent_code_by_name(IP) | Output: NA

More variables you find here.

Leave a Reply

Your email address will not be published. Required fields are marked *