PHP bin2hex() Function

The PHP bin2hex function is used to convert binary data into hexadecimal representation.

PHP bin2hex() Function

The PHP bin2hex function is used to convert binary data into hexadecimal representation.

Syntax

bin2hex(string_to_convert);

Example

<?php 
    $res = bin2hex("This is binary to hex conversion.");
    echo($res); 
?>

Output

546869732069732062696e61727920746f2068657820636f6e76657273696f6e2e

Here is a list of other PHP string handling functions.

Share Tweet Send
0 Comments
Loading...
You've successfully subscribed to GeekInsta
Great! Next, complete checkout for full access to GeekInsta
Welcome back! You've successfully signed in
Success! Your account is fully activated, you now have access to all content.