PHP进制转换的有关问题

WBOY
Release: 2016-06-13 11:50:19
Original
1205 people have browsed it

PHP进制转换的问题

本帖最后由 qq85168163 于 2014-03-10 14:13:19 编辑 比如二进制字符串, 11111111111111(14个)转换成16进制byte ( FF 3F 00 00 )


又如 11 转换成 03 00 00 00


应该怎么转换,是不是要用到pack函数?求实例!!!


折腾两天了,很急,求大神
------解决方案--------------------
$b = '11111111111111';<br />$d = bindec($b);<br />$h = pack('L', $d);<br /><br />echo bin2hex($h); //检验一下
Copy after login
ff3f0000
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template