Tuesday, January 3, 2012

How to get Geo Location Details using PHP ?

<?php 

$IP = $_SERVER['REMOTE_ADDR'];
$tags = get_meta_tags('http://www.geobytes.com/IpLocator.htm?GetLocation&template=php3.txt&IpAddress='.$IP);
print $tags['city'];  // city name
print $tags['country'];  // country name

?>

No comments:

Post a Comment