PHP Classes

GeoLocation: Get the location of an IP address with the hostip

Recommend this page to a friend!
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 54%Total: 3,998 All time: 785 This week: 339Up
Version License PHP version Categories
geolocation 0.2BSD License4.2Web services, Geography


This class can be used to determine the geographic location of an IP address using the Web services.

The class is guaranteed to work with PHP version 4.2 and PHP 5.2. There is some important information in the index.php file that gives hints to troubleshoot problems.

It accesses the Web services API site passing a given host IP address as query parameter.

The class retrieves and parses the response to return the country, the city, and the latitude and longitude coordinates of the specified host.

Picture of Jillis ter Hove
Name: Jillis ter Hove <contact>
Classes: 1 package by
Country: The Netherlands The Netherlands
Age: 42
All time rank: 77821 in The Netherlands The Netherlands
Week rank: 586 Up16 in The Netherlands The Netherlands Up

  Files folder image Files  
File Role Description
Plain text file GeoLocation.class.php Class Main class file
Accessible without login Plain text file index.php Example Example usage of the class
Accessible without login Plain text file PHP45.XML.php Aux. Wrapper for differences in XML handling in php 4 and php 5.

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:785
This week:339Up
User Ratings User Comments (1)
 All time