PHP hex2bin() 函数

PHP 教程 · 2019-01-29 14:11:35

实例

把十六进制值转换为 ASCII 字符:

<?php
echo hex2bin("48656c6c6f20576f726c6421");
?>

以上实例输出结果:

Hello World!

定义和用法

hex2bin() 函数把十六进制值的字符串转换为 ASCII 字符。

语法


hex2bin(string)


参数 描述
string 必需。要转换的十六进制值。

技术细节

返回值: 返回转换字符串的 ASCII 字符,如果失败则返回 FALSE。
PHP 版本: 5.4.0+
更新日志: 自 PHP 5.4.1 起,如果字符串长度为奇数,则抛出一个警告。在 PHP 5.4.0 中,奇数字符串被默默接受,但是最后一个字节会被移除。

自 PHP 5.5.1 起,如果字符串是无效的十六进制字符串,则抛出一个警告。

点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html

查看所有标签

Cypherpunks

Cypherpunks

Julian Assange、Jacob Appelbaum、Andy Müller-Maguhn、Jérémie Zimmermann / OR Books / 2012-11 / GBP 8.99

Cypherpunks are activists who advocate the widespread use of strong cryptography (writing in code) as a route to progressive change. Julian Assange, the editor-in-chief of and visionary behind WikiLea......一起来看看 《Cypherpunks》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换