Home >Backend Development >PHP Tutorial > php利用QQ获取ip,省份,市

php利用QQ获取ip,省份,市

WBOY
WBOYOriginal
2016-06-13 13:02:44932browse

php利用QQ获取ip,省,市

<?php 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;    
}   
  $ip=get_ip_place();   
  print_r($ip); 
?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn