当前位置:网站首页>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
边栏推荐
- Design and implementation of communication protocol
- 【统计学习方法】学习笔记——支持向量机(下)
- Leetcode skimming: binary tree 22 (minimum absolute difference of binary search tree)
- Cryptography series: detailed explanation of online certificate status protocol OCSP
- visual stdio 2017关于opencv4.1的环境配置
- Day-24 UDP, regular expression
- Charles: four ways to modify the input parameters or return results of the interface
- What is an esp/msr partition and how to create an esp/msr partition
- Aike AI frontier promotion (7.7)
- HZOJ #240. 图形打印四
猜你喜欢

leetcode刷题:二叉树26(二叉搜索树中的插入操作)

【统计学习方法】学习笔记——提升方法

2022 practice questions and mock examination of the third batch of Guangdong Provincial Safety Officer a certificate (main person in charge)

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

爱可可AI前沿推介(7.7)

2022广东省安全员A证第三批(主要负责人)考试练习题及模拟考试
![[statistical learning methods] learning notes - improvement methods](/img/c5/515f171995da8e424de290228b54f8.png)
[statistical learning methods] learning notes - improvement methods

Several ways to clear floating
![[爬虫]使用selenium时,躲避脚本检测](/img/3a/85ea729be2aa76c3de4a822ca6939b.png)
[爬虫]使用selenium时,躲避脚本检测
![[pytorch practice] use pytorch to realize image style migration based on neural network](/img/20/8ed7113115709b6169be289b0c280a.png)
[pytorch practice] use pytorch to realize image style migration based on neural network
随机推荐
如何将 @Transactional 事务注解运用到炉火纯青?
On valuation model (II): PE index II - PE band
Realize all, race, allsettled and any of the simple version of promise by yourself
[疑难杂症]pip运行突然出现ModuleNotFoundError: No module named ‘pip‘
【统计学习方法】学习笔记——逻辑斯谛回归和最大熵模型
Leetcode brush questions: binary tree 19 (merge binary tree)
OSPF exercise Report
Cryptography series: detailed explanation of online certificate status protocol OCSP
[learn microservices from 0] [03] explore the microservice architecture
Day-24 UDP, regular expression
智云健康上市:市值150亿港元 SIG经纬与京新基金是股东
[binary tree] delete points to form a forest
leetcode刷题:二叉树19(合并二叉树)
.Net下极限生产力之efcore分表分库全自动化迁移CodeFirst
[learn wechat from 0] [00] Course Overview
HZOJ #236. Recursive implementation of combinatorial enumeration
Charles: four ways to modify the input parameters or return results of the interface
[learn micro services from 0] [02] move from single application to service
高瓴投的澳斯康生物冲刺科创板:年营收4.5亿 丢掉与康希诺合作
利用栈来实现二进制转化为十进制