Convert IP to number, convert number to IP_PHP tutorial

WBOY
Release: 2016-07-13 17:38:49
Original
916 people have browsed it

echo $a=ip2long ("202.97.224.68");
echo "
-
";
echo long2ip ($a);

Note: There is something to note here. Probably because PHP cannot correctly determine the converted number type, negative numbers appear.

At this time, you can use bindec(decbin(ip2long($IP))) to process it.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486453.htmlTechArticleecho $a=ip2long (202.97.224.68); echo br /-br /; echo long2ip ($a) ; Note: There is something to note here. Probably because PHP cannot correctly determine the converted number type, negative...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template