WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Ip2country

Plugin converts IP-address to the country.

Get country code or country name:

<?php
$ip2country = ip2country();
echo ' Country code: '.$ip2country->country_code;
echo ' Country name: '.$ip2country->country_name;
// or
$ip2country2 = ip2country('212.113.46.148');
echo ' Country code: '.$ip2country2->country_code;
echo ' Country name: '.$ip2country2->country_name;
?>

Get additional info about the country by country code:

<?php
$ip2country_info = ip2country_info($ip2country->country_code);
echo ' iso_code_2: '.$ip2country_info->iso_code_2;
echo ' iso_code_3: '.$ip2country_info->iso_code_3;
echo ' iso_country: '.$ip2country_info->iso_country;
echo ' country: '.$ip2country_info->country;
echo ' lat: '.$ip2country_info->lat;
echo ' lon: '.$ip2country_info->lon;
// or
$ip2country_info = ip2country_info('us');
echo ' lat: '.$ip2country_info->lat;
echo ' lon: '.$ip2country_info->lon;
?>

Ip2country support page

Useful plugins:

Requires: 3.0 or higher
Compatible up to: 3.5.2
Last Updated: 2012-11-7
Downloads: 2,058

Ratings

5 stars
5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

1 person says it works.
0 people say it's broken.

100,1,1 100,1,1
100,1,1 100,1,1
100,1,1 100,1,1
100,1,1 100,1,1
100,1,1 100,1,1
100,1,1 100,1,1
100,1,1 100,2,2
100,1,1 100,1,1
100,1,1 100,1,1
100,1,1 100,1,1
100,1,1 100,1,1
100,1,1 100,2,2
100,2,2
100,1,1 100,1,1
100,1,1 100,1,1
100,1,1
100,1,1 100,1,1
100,1,1 100,1,1
100,1,1 100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1