Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkregional_ip2country($ip) {
- $gi = geoip_open("GeoIP.dat", GEOIP_STANDARD);
- $id = geoip_country_id_by_addr_v6($gi, checkregional_ipv4to6($ip));
- if ($id) {
- $ccode = $gi->GEOIP_COUNTRY_CODES[$id];
- $cname = $gi->GEOIP_COUNTRY_NAMES[$id];
- }
- else {
- $ccode = 'unknown';
- $cname = 'unknown';
- }
- geoip_close($gi);
- return array('cc' => $ccode,'name' => $cname);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement