function get_content($URL){
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $URL);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$ip = $_SERVER['REMOTE_ADDR'];
$url = "http://ip-api.com/xml/". $ip. "?fields=regionName";
$veri = get_content($url);
$xml = simplexml_load_string($veri);
echo (string)$xml->regionName ;