echo $a=ip2long ("202.97.224.68");
echo "
-
";
echo long2ip ($a);
注:这里面有一个要注意的地方,大概由于PHP无法正确判断转换完的数字类型,出现负数的情况。
这时可用bindec(decbin(ip2long($IP))) 处理一下。
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn