The Code-Bin
Ip2long example
Posted by: Stephen | June 16, 2007 @ 7:52am
Revision 1 - Original post on June 16, 2007 @ 7:50am

PHP Code



Syntax Highlighting





Author Comments

Demo


This is a function in PHP that will convert a decimal-dotted IP address into a simple decimal IP address. It converts each octet into its hexadecimal equivalent, creating a hex number, and converts that into a decimal number.

This function is great for validating IP addresses because you need not worry about octets and periods.
Rating


4.58 / 8
768 Votes