<?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 a 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]
- How to increase the execution timeout in php?
- SELECT * FROM in MySQLi
- prevent direct url access to php file
- Convert tiff to jpg in php?
- How can I use “Dependency Injection” in simple php functions, and should I bother?
- Can I detect and handle MySQL Warnings with PHP?
- Perl equivalent of PHP’s escapeshellarg