当前位置:网站首页>ip2long与long2IP 分析
ip2long与long2IP 分析
2022-07-07 10:36:00 【全栈程序员站长】
<?php
$ip='47.93.97.127';
$long=sprintf("%u",ip2long($ip));//string(9) "794648959" 9位
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位
echo "<br>";
var_dump(long2ip($long2));//string(15) "247.193.197.127"
$ip=’47.93.97.127′;只要47变为三位数,转化为整数后就是10位,需要sprintf函数的转化,否则出现负数
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/113446.html原文链接:https://javaforall.cn
边栏推荐
- 【统计学习方法】学习笔记——支持向量机(上)
- [statistical learning method] learning notes - support vector machine (I)
- Tutorial on principles and applications of database system (009) -- conceptual model and data model
- Cenos openssh upgrade to version 8.4
- 【统计学习方法】学习笔记——第四章:朴素贝叶斯法
- SQL Lab (46~53) (continuous update later) order by injection
- Session
- About IPSec
- Several methods of checking JS to judge empty objects
- (待会删)yyds,付费搞来的学术资源,请低调使用!
猜你喜欢
SQL Lab (41~45) (continuous update later)
[pytorch practice] use pytorch to realize image style migration based on neural network
静态Vxlan 配置
2022A特种设备相关管理(锅炉压力容器压力管道)模拟考试题库模拟考试平台操作
The road to success in R & D efficiency of 1000 person Internet companies
Customize the web service configuration file
Tutorial on principles and applications of database system (010) -- exercises of conceptual model and data model
opencv的四个函数
(待会删)yyds,付费搞来的学术资源,请低调使用!
Static routing assignment of network reachable and telent connections
随机推荐
[pytorch practice] use pytorch to realize image style migration based on neural network
图像像素读写操作
Will the filing free server affect the ranking and weight of the website?
利用棧來實現二進制轉化為十進制
Idea 2021 Chinese garbled code
DOM parsing XML error: content is not allowed in Prolog
Tutorial on principles and applications of database system (010) -- exercises of conceptual model and data model
Error in compiling libssl
gcc 编译报错
SQL Lab (36~40) includes stack injection, MySQL_ real_ escape_ The difference between string and addslashes (continuous update after)
Vxlan static centralized gateway
Tutorial on principles and applications of database system (007) -- related concepts of database
Realize a simple version of array by yourself from
【PyTorch实战】用PyTorch实现基于神经网络的图像风格迁移
ps链接图层的使用方法和快捷键,ps图层链接怎么做的
【从 0 开始学微服务】【00】课程概述
SQL injection -- Audit of PHP source code (take SQL lab 1~15 as an example) (super detailed)
The hoisting of the upper cylinder of the steel containment of the world's first reactor "linglong-1" reactor building was successful
Minimalist movie website
BGP third experiment report