English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP String String Functions Manual
bin2The hex() function is used to convert a binary string containing data into a hexadecimal value
string bin2hex ( string $str )
Converts the binary parameter str to a hexadecimal string. The conversion uses byte-wise, with the most significant byte first.
It returns the escaped string
Serial Number | Parameter and Description |
---|---|
1 | str Binary String. |
Try the following example, convert "w3codebox" converted to hexadecimal value:
<?php //Convert "w3codebox" converted to hexadecimal value $binary = "w3codebox"; $hex = dechex(bindec($binary)); echo $hex; ?>Test and See ‹/›
Output Result
0