Home >Backend Development >PHP Tutorial >怎么把4字节数字转为16进制?

怎么把4字节数字转为16进制?

WBOY
WBOYOriginal
2016-06-23 13:52:131358browse

我只知道dechex函数,但转出来是 

echo dechex(1407401322869);

afa7e975

计算器选四字节出来的结果147afa82c60 才是我要的结果

请问怎么用PHP实现?


回复讨论(解决方案)

你那是什么计算器?
应该是 147AFA7E975

echo base_convert(1407401322869, 10, 16); //147afa7e975

你计算器有问题吧。

不对啊 版主,我刚才没测试
测试一下

echo base_convert(1407401322869, 10, 16); //显示是cccdc8f1ea8  ?

帮帮忙 感谢

提问题里写错了,结果应该就是 147afa7e975
但是我用base_convert出来结果是cccdc8f1ea8  怎么回事呢

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn