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

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

WBOY
WBOYOriginal
2016-06-23 14:09:541084browse

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


回复讨论(解决方案)

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

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

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