.


Divya

bin2hex() Function in PHP


In PHP the bin2hex() function is used to converts a string of ASCII characters to hexadecimal values.

Syntax

bin2hex(string)

Example

<!DOCTYPE html>
<html>
<body>
<?php
$str = bin2hex("Hello World!");
echo($str);
?>
</body>
</html>
Output

48656c6c6f20576f726c6421



.