当前位置:网站首页>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
边栏推荐
- The IDM server response shows that you do not have permission to download the solution tutorial
- [learn wechat from 0] [00] Course Overview
- HZOJ #236. 递归实现组合型枚举
- 用mysql查询某字段是否有索引
- 《ASP.NET Core 6框架揭秘》样章[200页/5章]
- Leetcode skimming: binary tree 22 (minimum absolute difference of binary search tree)
- leetcode刷题:二叉树22(二叉搜索树的最小绝对差)
- 图像像素读写操作
- 2022 practice questions and mock examination of the third batch of Guangdong Provincial Safety Officer a certificate (main person in charge)
- Session
猜你喜欢
visual stdio 2017关于opencv4.1的环境配置
Leetcode skimming: binary tree 22 (minimum absolute difference of binary search tree)
2022a special equipment related management (boiler, pressure vessel and pressure pipeline) simulated examination question bank simulated examination platform operation
Leetcode skimming: binary tree 23 (mode in binary search tree)
Static routing assignment of network reachable and telent connections
Charles: four ways to modify the input parameters or return results of the interface
ACL 2022 | small sample ner of sequence annotation: dual tower Bert model integrating tag semantics
Preorder, inorder and postorder traversal of binary tree
leetcode刷题:二叉树22(二叉搜索树的最小绝对差)
leetcode刷题:二叉树27(删除二叉搜索树中的节点)
随机推荐
在字符串中查找id值MySQL
[Q&A]AttributeError: module ‘signal‘ has no attribute ‘SIGALRM‘
[statistical learning method] learning notes - support vector machine (I)
ip2long之后有什么好处?
About IPSec
Charles: four ways to modify the input parameters or return results of the interface
博文推荐|Apache Pulsar 跨地域复制方案选型实践
Design and implementation of communication protocol
.Net下极限生产力之efcore分表分库全自动化迁移CodeFirst
Connect to blog method, overload, recursion
[疑难杂症]pip运行突然出现ModuleNotFoundError: No module named ‘pip‘
Leetcode skimming: binary tree 21 (verifying binary search tree)
@What is the difference between resource and @autowired?
Day-14 common APIs
Leetcode skimming: binary tree 20 (search in binary search tree)
How to use PS link layer and shortcut keys, and how to do PS layer link
NPM instal reports agent or network problems
[learn microservices from 0] [03] explore the microservice architecture
[statistical learning method] learning notes - logistic regression and maximum entropy model
Cryptography series: detailed explanation of online certificate status protocol OCSP