当前位置:网站首页>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
边栏推荐
- Day-19 IO stream
- Leetcode question brushing: binary tree 26 (insertion operation in binary search tree)
- Importance of database security
- leetcode刷题:二叉树22(二叉搜索树的最小绝对差)
- 博文推荐|Apache Pulsar 跨地域复制方案选型实践
- 智云健康上市:市值150亿港元 SIG经纬与京新基金是股东
- 2022a special equipment related management (boiler, pressure vessel and pressure pipeline) simulated examination question bank simulated examination platform operation
- Realize all, race, allsettled and any of the simple version of promise by yourself
- [疑难杂症]pip运行突然出现ModuleNotFoundError: No module named ‘pip‘
- MPLS experiment
猜你喜欢

leetcode刷题:二叉树21(验证二叉搜索树)

Day-14 common APIs

Sorting, dichotomy

Visual stdio 2017 about the environment configuration of opencv4.1

How to apply @transactional transaction annotation to perfection?
![[crawler] avoid script detection when using selenium](/img/3a/85ea729be2aa76c3de4a822ca6939b.png)
[crawler] avoid script detection when using selenium

Pule frog small 5D movie equipment | 5D movie dynamic movie experience hall | VR scenic area cinema equipment

【PyTorch实战】用PyTorch实现基于神经网络的图像风格迁移

leetcode刷题:二叉树27(删除二叉搜索树中的节点)

The left-hand side of an assignment expression may not be an optional property access. ts(2779)
随机推荐
Four functions of opencv
Simple implementation of call, bind and apply
【统计学习方法】学习笔记——支持向量机(上)
mysql怎么创建,删除,查看索引?
BGP third experiment report
通讯协议设计与实现
HZOJ #235. 递归实现指数型枚举
[statistical learning methods] learning notes - Chapter 4: naive Bayesian method
[statistical learning methods] learning notes - improvement methods
OSPF exercise Report
达晨与小米投的凌云光上市:市值153亿 为机器植入眼睛和大脑
What if the xshell evaluation period has expired
聊聊Redis缓存4种集群方案、及优缺点对比
Creation and assignment of graphic objects
Dialogue with Wang Wenyu, co-founder of ppio: integrate edge computing resources and explore more audio and video service scenarios
BGP actual network configuration
What is an esp/msr partition and how to create an esp/msr partition
Master formula. (used to calculate the time complexity of recursion.)
Leetcode brush questions: binary tree 19 (merge binary tree)
2022-07-07日报:GAN发明者Ian Goodfellow正式加入DeepMind