How to get timezone by IP [duplicate]

荒凉一梦 提交于 2019-12-12 11:17:31

问题


I have a registration by which i can get the IP address of user who registers.

I want to get the timezone of user by his IP address.

Like in jquery we can get like this Timezone in jquery

How can i do it in PHP.


回答1:


You can use GeoIP based services http://www.php.net/manual/en/book.geoip.php

Or

You can use online services that gives timezone of the IP that you supply in request

i.e.

$tags = get_meta_tags('http://www.geobytes.com/IpLocator.htm?GetLocation&template=php3.txt&IpAddress=94.55.180.139'); 
echo $tags['timezone'];


来源:https://stackoverflow.com/questions/21826828/how-to-get-timezone-by-ip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!