Get geo location details in php using Api with source code

IP Geolocation is free for non commerical use api key not required this is usefull for website knowing the detail of users location on your website it is easy to code . fast and secure available in all format like JSON, PHP, CSV, XML

There are many company providing geo location data but its to costly but geolocation is free for small use geolocation API provide details like Ip , city , country , longitude , latitude , zip code , isp etc. Many developers are using this service for users location.


<!DOCTYPE html>
	<title>IP Geo Location</title>
<h1>Ip Geo Location in PHP</h1>
$ch =curl_init();
curl_setopt($ch, CURLOPT_URL, "");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if ($result->status=='success') {
	echo "IP Address:".$result->query.'<br/>';
	echo "Country:".$result->country.'<br/>';
	echo "City:".$result->city.'<br/>';
	echo "Timezone:".$result->timezone.'<br/>';
	echo "Region:".$result->region.'<br/>';
   	echo "Lat:".$result->lat.'<br/>';
   	echo "lon:".$result->lon.'<br/>';
        echo "Zip:".$result->zip.'<br/>';