PHP. Руководство по PHP. 2005
ip2long
ip2long
(PHP 4, PHP 5)ip2long --
Converts a string containing an (IPv4) Internet Protocol dotted address
into a proper address
Description
int ip2long (string ip_address)The function ip2long() generates an IPv4 Internet
network address from its Internet standard format (dotted string)
representation. If ip_address is invalid then
-1 is returned. Note that -1
does not evaluate as FALSE in PHP.
Замечание:
As of PHP 5.0.0 ip2long() returns FALSE when
ip_address is invalid.
Замечание:
Because PHP's integer type is signed, and many IP addresses will
result in negative integers, you need to use the "%u" formatter of
the string representation of the unsigned IP address.