<?php
$ip=$_SERVER['REMOTE_ADDR'];
$veri=file_get_contents("http://ip-api.com/xml/$ip");
preg_match("@<regionName>(.*?)</regionName>@si",$veri,$yazdir);
$yazdir[1]=str_replace("<![CDATA[",''",$yazdir[1]);
$yazdir[1]=str_replace("]]>","'',$yazdir[1]);
echo "$yazdir[1]";
?>
hocam bide böyle deneyin