September 2001
Intermediate to advanced
768 pages
32h 45m
English
int ip2long(string ip_address) Converts a dotted-quad address into a decimal, IPv4 network address.
Returns:
Signed integer
Description:
ip2long() converts a dotted-quad format IP address (xxx.xxx.xxx.xxx) to a decimal, IPv4 network address. Add pow(2,32) (4,294,967,296) to “unsign” the value.
Availability:
UNIX, Windows
Version:
4.0b4+
See also:
long2ip()
Example:
$IP = '63.69.110.220';
// We add 2^32 (4,294,967,296) to unsign the value
echo "The dotted-quad format IP address $IP is equivalent to ",
ip2long ($IP) + pow(2,32);
|
Read now
Unlock full access