Home > Backend Development > PHP Tutorial > 字符串怎样转成16进制的数

字符串怎样转成16进制的数

WBOY
Release: 2016-06-23 14:09:54
Original
1083 people have browsed it

例如:将字符串ffd8ffe000,转成16进制的ff d8 ff e0 00


回复讨论(解决方案)

$h = pack('H*', 'ffd8ffe000');

php 5.4 还可以
$h = hex2bin('ffd8ffe000');

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