1

I have used the date_default_timezone_set() to check and set the server time.

In the same way is this possible to get the server country in php?

Thanks in advance..

Pragnesh Chauhan
  • 8,363
  • 9
  • 42
  • 53
mangala
  • 143
  • 1
  • 2
  • 13
  • possible duplicate of [Get Country of IP Address with PHP](http://stackoverflow.com/questions/3650006/get-country-of-ip-address-with-php) – Elias Van Ootegem Oct 24 '13 at 07:27

2 Answers2

1

There's no such function in PHP, but you can get the country from remote IP with a little help of some database like this.

Jan Turoň
  • 31,451
  • 23
  • 125
  • 169
1

You can use the host.info api, combined with $_SERVER['SERVER_NAME']... easy.

This question is a dupe, though, and the duplicate question (auto-commented) contains some more alternative API's you can use

Elias Van Ootegem
  • 74,482
  • 9
  • 111
  • 149