Login   Register  
PHP Classes
elePHPant
Icontem

phpIP2Country: Determine the country of an IP in a database

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2007-02-20 (7 years ago) RSS 2.0 feedNot enough user ratingsTotal: 1,182 This week: 1All time: 2,959 This week: 1,386Up
Version License Categories  
phpip2country 1.0GNU General Public Lice...Databases, Geography
Description Author  

This class can be used to determine the country of a given IP searching in an IP range database.

It accesses a SQL database that has a table with the countries associated to each known IP range.

The IP address to check is searched to determine which IP range it belongs. If its IP range is found, the class returns the associated country code.

The IP ranges database table can be populated with separate script from IP range file in CVS format that can be obtained from the IP to country service site.

Picture of Mike Leigh
Name: Mike Leigh <contact>
Classes: 7 packages by
Country: United Kingdom United Kingdom
Age: 37
All time rank: 26613 in United Kingdom United Kingdom
Week rank: 56 Up1 in United Kingdom United Kingdom Up

  Files folder image Files  
File Role Description
Accessible without login Plain text file CHANGELOG Doc. Change Log
Plain text file ip2country.class.php Class phpIP2Country Main Class
Accessible without login Plain text file test.ip2country.class.php Example Example Usage
Accessible without login Plain text file populate_database.php Aux. Script to populate the database with the CSV Data
Accessible without login Plain text file LICENCE Lic. License File
Accessible without login Plain text file INSTALL Doc. Installation
Accessible without login Plain text file README Doc. Readme

Downloadphpip2country-2007-02-20.zip 9KB
Downloadphpip2country-2007-02-20.tar.gz 8KB
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
phpDB Download .zip .tar.gz Communication with the Database Required
phpCSV Download .zip .tar.gz Required to read the IP CSV Data feed Required
phpFile Download .zip .tar.gz Used to access the filesystem Required
 Version Control Unique User Downloads Download Rankings  
 0%Total:1,182All time:2,959
 This week:1This week:1,386Up