当前位置:Gxlcms > PHP教程 > php利用QQ获取ip,省份,市

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

时间:2021-07-01 10:21:17 帮助过:5人阅读

php利用QQ获取ip,省,市
  1. <!--?php
  2. function get_ip_place(){
  3. $ip=file_get_contents("http://fw.qq.com/ipaddress"); $ip=str_replace('"',' ',$ip);
  4. $ip2=explode("(",$ip);
  5. $a=substr($ip2[1],0,-2);
  6. $b=explode(",",$a);
  7. return $b;
  8. }
  9. $ip=get_ip_place();
  10. print_r($ip);
  11. ?-->

人气教程排行