yeah, you can type
$ip = $_SERVER['REMOTE_ADDR'];
to get the visitors ip address. Then, you can get a county/city by using a geoip service such as the one from www.maxmind.com. php.net uses this to control which mirror visitors are directed too, but i can't remember the one they use (although it is free!)
hope this helps
adam