English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
ip2The long() function converts IPV4 the string Internet Protocol to a long integer number.
int ip2long ( string $ip_address )
It is used to convert ipv4Address converted to a long integer.
Returns the numeric representation of the IP address or FALSE if ip_address is invalid.
Number | Parameter and Description |
---|---|
1 | ip_address It contains an IP address. |
Try the following example
<?php $ip = gethostbyname('www.oldtoolbag.com'); $out = 'The following three URLs are equivalent: \n"; $out .= 'http://www.oldtoolbag.com/, http://' . $ip . '/, and http://' . sprintf("眻, ip2long($ip)) . "/ \n"; echo $out; ?>
Output Result
The following three URLs are equivalent: http://www.oldtoolbag.com/, http://39.107.75.220/, http://661343196/