$ip= getenv(“REMOTE_ADDR”) ;
Your IP Address is:
$client = @$_SERVER[‘HTTP_CLIENT_IP’];
$forward = @$_SERVER[‘HTTP_X_FORWARDED_FOR’];
$remote = $_SERVER[‘REMOTE_ADDR’];
$result = “Unknown”;
$ip = $client;
$ip = $forward;
$ip = $remote;
$ip_data = @json_decode(file_get_contents(“http://www.geoplugin.net/json.gp?ip=”.$ip));
if($ip_data && $ip_data->geoplugin_countryName != null)
$result = $ip_data->geoplugin_countryName;
And Its Located In :
echo visitor_country(); // Output Coutry name [Ex: United States]
Do You know what an IP Address is?
According to wikipedia :
An Internet Protocol address (IP address) is a numerical label assigned to each device (e.g., computer, printer) participating in a computer network that uses the Internet Protocol for communication.
An IP address serves two principal functions: host or network interface identification and location addressing.
Its role has been characterized as follows: “A name indicates what we seek. An address indicates where it is. A route indicates how to get there.”
In other words, An IP Address is a number that is used to identify an online device and also the number that the device uses to make communications with their computers. This can be taken as how we get mails into our mail boxes at home. So just like the way home addresses works, You cannot get any thing sent or received without a specific address