PHP hex2bin() Function
Definition
The hex2bin() function decodes a hexadecimally encoded binary string.
Syntax
PHP hex2bin() Function has the following syntax.
hex2bin(string)
Parameter
Parameter | Is Required | Description |
---|---|---|
string | Required. | The hexadecimal value to be converted |
Return
PHP hex2bin() Function returns the encoded binary string, or FALSE on failure.
Example
decodes a hexadecimally encoded binary string:
<?php
echo hex2bin("1231FFF23123");
?>