(PHP 5 >= 5.4.0, PHP 7, PHP 8)
hex2bin — 转换十六进制字符串为二进制字符串
string
十六进制表示的数据
返回给定数据的二进制表示 或者在失败时返回 false
。
如果输入的十六进制字符串是奇数长数或者无效的十六进制字符串将会抛出
E_WARNING
级别的错误。
示例 #1 hex2bin() 例子
<?php
$hex = hex2bin("6578616d706c65206865782064617461");
var_dump($hex);
?>
以上示例的输出类似于:
string(16) "example hex data"
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant