There is a PHP function called ip2long
, and one called long2ip
. Pretty cool function. It stores an IP address (16 byte string) as a 4 byte long. Pretty cool if you have to store a lot of IP addresses in a database. So I have learned something from my new book!