English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
ip2long()函数将 IPV4 的字符串互联网协议转换成长整型数字。
int ip2long ( string $ip_address )
它用于将ipv4地址转换为长整数。
返回IP地址转换后的数字 或 FALSE 如果 ip_address 是无效的。
序号 | 参数和说明 |
---|---|
1 | ip_address 它包含一个IP地址。 |
试试下面的实例
<?php $ip = gethostbyname('it.oldtoolbag.com'); $out = "以下三个URL是等效: \n"; $out .= 'http://it.oldtoolbag.com/, http://' . $ip . '/, 和 http://' . sprintf("眻, ip2long($ip)) . "/" \n"; echo $out; ?>
输出结果
以下三个URL等效: http://it.oldtoolbag.com/, http://39.107.75.220/, http://661343196/