<?php
$user_ip = getenv('REMOTE_ADDR');
$geo = unserialize(file_get_contents("http://www.geoplugin.net/php.gp?ip=$user_ip"));
$country = $geo["geoplugin_countryName"];
$city = $geo["geoplugin_city"];
?>
More Related Contents:
- Getting the location from an IP address [closed]
- Getting visitors country from their IP
- Get user’s current location
- How to log IP address in text file
- IP addresses in PHP
- Get Country of IP Address with PHP [duplicate]
- How to get Real IP from Visitor? [duplicate]
- How to handle IPv6 Addresses in PHP?
- Convert UTC offset to timezone or date
- How to get MAC address of client using PHP?
- select outgoing ip for curl request
- is there a good PHP geolocation service? [closed]
- How to detect country / location of visitor? [duplicate]
- IP address storing in MySQL database using PHP [duplicate]
- How to check an IP address is within a range of two IPs in PHP?
- How to get Time Zone through IP Address in PHP [duplicate]
- Getting list IPs from CIDR notation in PHP
- Geo Location based on IP Address – PHP [closed]
- how to redirect domain according to country IP address
- How to use HTTP_X_FORWARDED_FOR properly?
- How to identify server IP address in PHP
- How do I get the external IP of my server using PHP?
- Regex to match an IP address [closed]
- save user images in MYSQL database by which method? [closed]
- Insert string at specified position
- How can I set text value of SimpleXmlElement without using its parent?
- Setting PHP tmp dir – PHP upload not working
- UTF-8 character encoding battles json_encode() [duplicate]
- how to get user’s screen resolution with PHP [duplicate]
- PHP add up two time variables