Copy the code The code is as follows:
function get_ip_place()
{
$ip=file_get_contents("http://fw.qq.com/ipaddress");
$ip=str_replace('"', ' ',$ip);
$ip2=explode("(",$ip);
$a=substr($ip2[1],0,-2);
$b=explode(",",$ a);
return $b;
}
Copy the code The code is as follows:
function get_ip_arr()
{
$ip=file_get_contents("http://fw.qq.com/ipaddress");
preg_match_all("/"(.*)"/",$ip, $arr);
return $arr;
}
The above introduces the Dungeon Hunter 4 archive location code thief program that obtains geographical location through IP under PHP, including the Dungeon Hunter 4 archive location. I hope it will be helpful to friends who are interested in PHP tutorials.