PHP bin2hex() Function | Convert Binary to Hexadecimal

PHP bin2hex() Function

The bin2hex() function in PHP converts the specified string value of ASCII characters to hexadecimal value.

Syntax

Parameter

str(Required): This parameter represents the string to be converted into hexadecimal.

Return 

This function returns the hexadecimal representation for the specified string.

Example 1

Output

Example 2

Output

Example 3

Output

Example 4

Output