-4

我在 php 中通过 ip addresse 获取城市时遇到了一个大问题,代码昨天可以工作,但现在我收到一个错误:限制超出,我的代码:

 public function getCityAndCountryByIp($ip){
    //get the city
    $tags = get_meta_tags('http://www.geobytes.com/IpLocator.htm?GetLocation&template=php3.txt&IpAddress='.$ip);

    $result = $tags['city'];
    return $result;

请帮帮我,代码可以更早地工作,请有任何建议

4

2 回答 2

2

错误限制超出应该非常清楚,您使用了给定时间段内的所有免费请求。您应该为更多请求购买许可证,或使用免费服务。

于 2014-09-15T08:01:02.433 回答
0

使用 php geoip 扩展,它有一个免费和商业版本http://php.net/manual/en/book.geoip.php

于 2014-09-15T08:05:23.090 回答