当前位置:网站首页>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
边栏推荐
猜你喜欢
Leetcode skimming: binary tree 22 (minimum absolute difference of binary search tree)
3D content generation based on nerf
BGP third experiment report
Cookie
2022危险化学品生产单位安全生产管理人员考题及在线模拟考试
OSPF exercise Report
Vxlan static centralized gateway
The left-hand side of an assignment expression may not be an optional property access. ts(2779)
ICLR 2022 | 基于对抗自注意力机制的预训练语言模型
【统计学习方法】学习笔记——提升方法
随机推荐
【统计学习方法】学习笔记——支持向量机(上)
Leetcode skimming: binary tree 21 (verifying binary search tree)
Four functions of opencv
[爬虫]使用selenium时,躲避脚本检测
@Resource和@Autowired的区别?
[Q&A]AttributeError: module ‘signal‘ has no attribute ‘SIGALRM‘
leetcode刷题:二叉树22(二叉搜索树的最小绝对差)
[statistical learning method] learning notes - support vector machine (I)
Realize all, race, allsettled and any of the simple version of promise by yourself
明星企业普渡科技大裁员:曾募资超10亿 腾讯红杉是股东
Layer pop-up layer closing problem
【从 0 开始学微服务】【01】什么是微服务
2022聚合工艺考试题模拟考试题库及在线模拟考试
Pule frog small 5D movie equipment | 5D movie dynamic movie experience hall | VR scenic area cinema equipment
test
Charles: four ways to modify the input parameters or return results of the interface
Leetcode question brushing: binary tree 26 (insertion operation in binary search tree)
2022-07-07 Daily: Ian Goodfellow, the inventor of Gan, officially joined deepmind
ip2long与long2IP 分析
非分区表转换成分区表以及注意事项