PHP Classes

PHP Fast IP Address Locator: Get the location of an IP using IPLocation files

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Info   Demos   Screenshots Screenshots   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2015-05-28 (3 months ago) RSS 2.0 feedNot enough user ratingsTotal: 459 This week: 1All time: 5,652 This week: 1,105Up
Version License PHP version Categories  
fast-ip-locator 1.0.10MIT/X Consortium ...5.3Networking, PHP 5, Geography
Description Author  

This class can get the location of an IP address using IPLocation service database files.

It can install the files of IP range blocks from an archive obtained from the IPLocation service.

The class can get the location of an IP address by looking up at the right files depending on the IP address.

Picture of Andras Toth
Name: Andras Toth <contact>
Classes: 3 packages by
Country: Hungary Hungary
Age: 42
All time rank: 213819 in Hungary Hungary
Week rank: 557 Up5 in Hungary Hungary Up

Details provided by the author  

Fast ip parsing from local file, using ip2Location CSV database.

- Very simple usage
- Working with all ip2Location database CSV version
- Parsing time close to mysql selection time
- IPV4 Or IPV6

[FastSpeedIpLocator] - Online Demo 

<img src = "capture.jpg" width="640" height="360"/>



- PHP Web server 5.5 or above

- Copy whole folder (iplocator) to your web server.
- Download csv database from [ip2location], Lite is free!
- install blocks at first, -> index.php

index.php - example

	require_once ('IpLocator.php');
	if (isset($_POST['look']) && (isset($_POST['inp']) || $_POST['inp'] != '')) {
    	$curTime = microtime(true);
    	$loc = IpLocator::getInstance();
    	$res = $loc->LocateIp($_POST['inp']);
    	$elp = (round(microtime(true) - $curTime, 3) * 1000);
    	echo '<br>';
    	foreach ($res as $key => $value) {
        	echo $key . ' => ' . $value . '<br>';
    	echo '<br>';
    	echo 'Elpassed time: ' . $elp . ' Us';
	$filename = 'update/*.[zZ][iI][pP]';
	if (isset($_POST['install']) && count(glob($filename)) > 0) {
		ini_set('max_execution_time', 300);
    	$loc = IpLocator::getInst	            
    	//InstallBlocks(true for optimize best performance OR rows per indexed file, true for delete temp files);15.6965
    	$loc->InstallBlocks(glob($filename) [0], true, true);
	else if (isset($_POST['install']) && count(glob($filename)) === 0) {
    	echo 'Data file (update/*.ZIP) is not exist!<br>';
    	echo 'Register to <a href = ""></a><br>';
    	echo 'Download IP Location Database CSV in Zip format and copy to update folder.';


Author: Tóth András


  demoExternal page  
  • demo3
  • demo2
  • demo
  Files folder image Files  
File Role Description
Files folder imageiplocator (2 files)
Accessible without login Image file capture.jpg Data Auxiliary data
Accessible without login Plain text file Data Auxiliary data

  Files folder image Files  /  iplocator  
File Role Description
  Accessible without login Plain text file index.php Example Unit test script
  Plain text file IpLocator.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 57%Total:459All time:5,652
 This week:1This week:1,105Up