int ip2long ( string $ip_address )
它用于将IPv4地址转换为长整数。
Sr.No | 参数 & Description |
---|---|
1 |
ip_address 它包含IP地址。 链接:https://www.learnfk.comhttps://www.learnfk.com/php/php-function-ip2long.html 来源:LearnFk无涯教程网 |
它返回LONG INTEGER(长整数),否则显示一条消息,表示IP地址无效。
<?php $ip=gethostbyname('www.learnfk.com'); $out="The following URLs are equivalent: \n"; $out .= 'http://www.learnfk.com/, http://' . $ip . '/, and http://' . sprintf("%u", ip2long($ip)) . "/ \n"; echo $out; ?>
这将产生以下输出-
The following URLs are equivalent: http://www.learnfk.com/, http://72.21.91.8/, and http://1209359112/
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)