PHP bin2hex() Function

by Rekha 2010-01-28 18:26:49

The bin2hex() function converts a string of ASCII characters to hexadecimal values. The string can be converted back using the pack() function.

Syntax:
bin2hex(string)


Example:

<?php
$str = "Hello world!";
echo bin2hex($str);
?>


The output of the code above will be:
48656c6c6f20776f726c6421

Tagged in:

1160
like
0
dislike
0
mail
flag

You must LOGIN to add comments