.
Divya
In PHP the bin2hex() function is used to converts a string of ASCII characters to hexadecimal values.
bin2hex(string)
<!DOCTYPE html>
<html>
<body>
<?php
$str = bin2hex("Hello World!");
echo($str);
?>
</body>
</html>
48656c6c6f20576f726c6421
.