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

查看所有标签

High Performance Python

High Performance Python

Andrew Lewis / O'Reilly Media, Inc. / 2010-09-15 / USD 34.99

Chapter 1. Introduction Section 1.1. The High Performance Buzz-word Chapter 2. The Theory of Computation Section 2.1. Introduction Section 2.2. Problems Section 2.3. Models of Computati......一起来看看 《High Performance Python》 这本书的介绍吧!

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

在线压缩/解压 CSS 代码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具