Get Country, City of Visitors Easy with PHP 5

This is full code for PHP

<?php
// Author: www.easyjquery.com
$ip = $_SERVER['REMOTE_ADDR'];
// remember chmod 0777 for folder 'cache'
$file = "./cache/".$ip;
if(!file_exists($file)) {
    // request
    $json = file_get_contents("http://api.easyjquery.com/ips/?ip=".$ip."&full=true");
    $f = fopen($file,"w+");
    fwrite($f,$json);
    fclose($f);
} else {
    $json = file_get_contents($file);
}

$json = json_decode($json,true);
echo "<pre>";
print_r($json);

?>

You can check demo here: [Link To Demo]

You can use this script to detect spammer, or verify order in shopping cart online, detect IP & Proxy …

Gets my region wrong.

Gets my region right.

Hope the site is going to be stable.

That is getting the location of the ISP or proxy server - not the location of your visitor. Your visitor could be on the opposite side of the world.

PHP Only detect IP by REMOTE_ADDR, in case your visitors use proxy, I have no idea how to check proxy and real ip.