Javatpoint Logo
Javatpoint Logo

PHP bin2hex() Function

PHP bin2hex() function is used to convert string value of ASSCII characters to hexadecimal value.


Parameter Description Required/Optional
string The string to be converted Required

Example 1


Your ASCII character is:Hello World!
By using 'bin2hex()' Method your hexadecimal value is: 48656c6c6f20576f726c6421

Note: Convert a string value into binary to hex.

Example 2


Your Hexadecimal Value is 48656c6c6f20776f726c6421
Hello world!

Example 3


Your Binary Value is11111001
Converted Binary to Hexadecimal : f9

Next TopicPHP String

Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA