PHP bin2hex() function


In this article, We will explain to you PHP bin2hex() function with example.

PHP bin2hex() function

The bin2hex() function is a string function. which is used to convert the string into hexadecimal values. so you can see our PHP String Function example.

Syntax

bin2hex(string);

Paramerter Option

stringThis is Required Paramerter and use the string

Example

<?PHP
    $str = "This is My website";
    echo bin2hex($str);
?>

Output

54686973206973204d792077656273697465