PHP Classes

Ip2Country: Detect the country and region of an IP address

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 791 All time: 4,317 This week: 146Up
Version License PHP version Categories
ip-country 0.1.1GNU General Publi...5.3Networking, PHP 5, Web services, Geog...
Description 

Author

This class can detect the country and region of an IP address.

It can detect the current user IP address and validate it to determine if it is from a public or private network.

The class can send a HTTP request to the IP2Country API to retrieve the country of the detected IP address.

Then it looks up internal arrays to determine if the country region is United States, Canada, Europe or Asia.

Picture of Anish Karim C
  Performance   Level  

 

Details

ip2Country is a PHP based class, helps loading or redirecting region-based website, to make sure each area is viewing the currect website. This class uses ip2country API to determine the country of the visitor, by finding the visitors IP and making sure it is not an internal IP. We are also using ipMango API to find the actual IP on all other methods failed. Currently we have included US, Canada, Europe and Asia Pacefic regions. You can extend the functionality by adding additional regions and country codes in the class. Examples are given in PHP class. /********Developed By: Anish Karim*********************** *********<thecoderin@gmail.com>************************* *********Version: 0.1.1********************************* *********Last Updated: April 7, 2014******************** ********************************************************/

  Files folder image Files (3)  
File Role Description
Accessible without login Plain text file index.php Example Example Script.
Plain text file ip2country.class.php Class ip2country class file
Accessible without login Plain text file README Data Readme file

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:791
This week:0
All time:4,317
This week:146Up
User Comments (1)
It misses Africa and South America
10 years ago (tuga cari)
22%StarStar