Menu Close

bin2hex() function PHP


The bin2hex() function used to Convert binary data into hexadecimal representation

Returns an ASCII string containing the hexadecimal representation of string. The conversion is done byte-wise with the high-nibble first.



Parameter Values

string : The string to be converted.

Technical Details

Return Value : Returns the hexadecimal value of the converted string.

PHP Version : 4+


$str = "Codeamend Team";
echo bin2hex($str) . "<br>";
echo pack("H*",bin2hex($str)) . "<br>";

Output : 
Codeamend Team 

How useful was this post?

Click on a star to rate it!

Average rating 4.5 / 5. Vote count: 13

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?


Posted in PHP

Leave a Reply

Your email address will not be published. Required fields are marked *

You can also read...