為了獲取IP地理位置,可以用騰訊的API接口,很方便。 [php] <?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); ?> [/php]
發(fā)表評論