当前位置:网站首页>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
边栏推荐
- 【从 0 开始学微服务】【03】初探微服务架构
- Epp+dis learning path (1) -- Hello world!
- Solutions to cross domain problems
- About sqli lab less-15 using or instead of and parsing
- 浅谈估值模型 (二): PE指标II——PE Band
- leetcode刷题:二叉树24(二叉树的最近公共祖先)
- Minimalist movie website
- leetcode刷题:二叉树23(二叉搜索树中的众数)
- Dialogue with Wang Wenyu, co-founder of ppio: integrate edge computing resources and explore more audio and video service scenarios
- [statistical learning method] learning notes - logistic regression and maximum entropy model
猜你喜欢

Minimalist movie website

NPM instal reports agent or network problems

The hoisting of the upper cylinder of the steel containment of the world's first reactor "linglong-1" reactor building was successful

30. Feed shot named entity recognition with self describing networks reading notes

Sort out the garbage collection of JVM, and don't involve high-quality things such as performance tuning for the time being

SQL lab 21~25 summary (subsequent continuous update) (including secondary injection explanation)

什么是ESP/MSR 分区,如何建立ESP/MSR 分区

Tutorial on principles and applications of database system (009) -- conceptual model and data model

ES底层原理之倒排索引

Several methods of checking JS to judge empty objects
随机推荐
Vxlan 静态集中网关
Tutorial on the principle and application of database system (011) -- relational database
SQL lab 26~31 summary (subsequent continuous update) (including parameter pollution explanation)
Cryptography series: detailed explanation of online certificate status protocol OCSP
Simple implementation of call, bind and apply
[statistical learning method] learning notes - support vector machine (Part 2)
普乐蛙小型5d电影设备|5d电影动感电影体验馆|VR景区影院设备
Niuke website
Several ways to clear floating
<No. 9> 1805. Number of different integers in the string (simple)
【统计学习方法】学习笔记——第五章:决策树
密码学系列之:在线证书状态协议OCSP详解
[deep learning] image multi label classification task, Baidu paddleclas
SQL head injection -- injection principle and essence
leetcode刷题:二叉树19(合并二叉树)
Simple network configuration for equipment management
GCC compilation error
Cenos openssh upgrade to version 8.4
EPP+DIS学习之路(2)——Blink!闪烁!
【二叉树】删点成林