当前位置:网站首页>Ip2long and long2ip analysis
Ip2long and long2ip analysis
2022-07-07 12:51:00 【Full stack programmer webmaster】
<?php
$ip='47.93.97.127';
$long=sprintf("%u",ip2long($ip));//string(9) "794648959" 9 position
var_dump($long);
echo "<br>";
$ip='247.193.197.127';
$long=ip2long($ip);//int(-138295937)
var_dump($long);
echo "<br>";
$ip='247.193.197.127';
$long2=sprintf("%u",ip2long($ip));
var_dump($long2); //string(10) "4156671359" 10 position
echo "<br>";
var_dump(long2ip($long2));//string(15) "247.193.197.127" $ip=’47.93.97.127′; as long as 47 Change to three digits , After converting to an integer, it is 10 position , need sprintf Function transformation , Otherwise, negative numbers appear
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/113446.html Link to the original text :https://javaforall.cn
边栏推荐
猜你喜欢

Multi row and multi column flex layout

2022危险化学品生产单位安全生产管理人员考题及在线模拟考试

【PyTorch实战】图像描述——让神经网络看图讲故事

Importance of database security

leetcode刷题:二叉树23(二叉搜索树中的众数)
![[爬虫]使用selenium时,躲避脚本检测](/img/3a/85ea729be2aa76c3de4a822ca6939b.png)
[爬虫]使用selenium时,躲避脚本检测

2022a special equipment related management (boiler, pressure vessel and pressure pipeline) simulated examination question bank simulated examination platform operation

IPv6 experiment

Sorting, dichotomy

Day22 deadlock, thread communication, singleton mode
随机推荐
[statistical learning method] learning notes - support vector machine (I)
[疑难杂症]pip运行突然出现ModuleNotFoundError: No module named ‘pip‘
Polymorphism, final, etc
【PyTorch实战】用RNN写诗
【从 0 开始学微服务】【00】课程概述
ip2long与long2IP 分析
Leetcode brush question: binary tree 24 (the nearest common ancestor of binary tree)
The left-hand side of an assignment expression may not be an optional property access. ts(2779)
Day-20 file operation, recursive copy, serialization
爱可可AI前沿推介(7.7)
BGP actual network configuration
Day21 multithreading
非分区表转换成分区表以及注意事项
GCC compilation error
ICLR 2022 | 基于对抗自注意力机制的预训练语言模型
Leetcode skimming: binary tree 21 (verifying binary search tree)
通讯协议设计与实现
[statistical learning method] learning notes - logistic regression and maximum entropy model
Day-15 common APIs and exception mechanisms
[crawler] avoid script detection when using selenium