• PHP Video Tutorials

PHP - Function hex2bin



Syntax

string hex2bin ( string $data )

Definition and Usage

It is used to convert a string of hexadecimal to ASCII character

Return Values

It returns the binary representation of given data or else false on failure.

Parameters

Sr.No Parameters & Description
1

data

It contains the information about Hexadecimal representation of data

Example

Try out the following example

<?php
   $hex = hex2bin("43480170");
   var_dump($hex);
?>

This will produce following result − −

string(4) "CHp"
php_function_reference.htm
Advertisements