$loc = (json_decode(file_get_contents("http://ipinfo.io/$_SERVER['REMOTE_ADDR']/geo")))->loc; echo $loc;