PHP Classes
elePHPant
Icontem

PHP IP Sorter: Sort an array of IP addresses

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2014-09-10 (2 years ago) RSS 2.0 feedStarStar 34%Total: 275 This week: 2All time: 7,192 This week: 591Up
Version License PHP version Categories
sorterip 1.0GNU General Publi...3.0Networking, Algorithms, PHP 5
Description Author

This class can sort an array of IP addresses.

It takes a list of IP v4 addresses and sorts them considering the numbers of its parts separated by dots starting from the first part number.

The class returns the same array with the address elements already sorted.

The sorting algorithm may be overridden providing a callback function to implement a different algorithm.

Innovation Award
PHP Programming Innovation award nominee
September 2014
Number 5


Prize: One downloadable copy of Komodo IDE
Some applications need to group IP addresses according to the networks they belong.

One solution for this problem is to sort the list of IP addresses, so addresses of the same network appear in the list together.

This class can sort a list of IP addresses considering the values of each part of the whole IP address.

Manuel Lemos
Picture of Luca Pacchiarotta
  Performance   Level  
Name: Luca Pacchiarotta <contact>
Classes: 1 package by
Country: Italy Italy
Innovation award
Innovation award
Nominee: 1x

Details
 +-------------------------------------+
 |     Sorter IP | v 1.0               |
 +-------------------------------------+



Sorter IP
  It's a PHP class to sort a list of IP addresses.

Luca Pacchiarotta
luca450mhz at inwind dot it
  Files folder image Files  
File Role Description
Accessible without login Plain text file demo.php Example A demo script
Accessible without login Plain text file license.txt Lic. License
Accessible without login Plain text file readme.txt Data Readme
Plain text file SorterIP.php Class The primary class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:275
This week:2
All time:7,192
This week:591Up
User Ratings User Comments (1)
 All time
Utility:41%StarStarStar
Consistency:50%StarStarStar
Documentation:-
Examples:83%StarStarStarStarStar
Tests:-
Videos:-
Overall:34%StarStar
Rank:2860
 
$tmp1 = explode('.
2 years ago (Dima Zan)
5%Star