hex2bin()


string hex2bin ( string $str )

Description

hex2bin() decodes a hexadecimal encoded string

※ available F/W version : all

Parameters

Return values

Returns the binary representation of the given string, PHP error on failure

Example

<?php
$hex = "48656C6C6F";
$bin = hex2bin($hex);

echo $bin;  // OUTPUT: Hello
?>

See also

bin2hex()

Remarks

This function is identical to the PHP group’s hex2bin() function.