PHP Classes
elePHPant
Icontem

Storeip: Store ip-addresses in a database

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2002-09-22 (14 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 1,467 All time: 2,579 This week: 1,748Up
Version License Categories
storeip 1.0GNU General Publi...Networking, Databases
Description Author

To Store ip-addresses in a database, you will
need a field type of Char(15).
This class let's you store the ipnumbers as
an integer ( between -2139062144 and 2139062143)

This class has two functions
1) decode ip->number
2) encode number->ip

Both functions return false for empty or wrong ip-numbers

While using this class you will spare typical 11 bytes
for every ipnumber you store.
Char(15) needs 15 Bytes
SIGNED INT(10) needs 4 Bytes

Picture of Bas Jobsen
Name: Bas Jobsen <contact>
Classes: 9 packages by
Country: The Netherlands The Netherlands

  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Example
Accessible without login Plain text file license.txt Lic. license
Accessible without login Plain text file php_and_mysql.txt Doc. IMPORTANT
Plain text file storeip.php Class Storeip

 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,467
This week:0
All time:2,579
This week:1,748Up