PHP: bin2hex() function
Description
The bin2hex() function converts a string of binary characters to hexadecimal values.
Version:
(PHP 4 and above)
Syntax:
bin2hex(string_name)
Parameter:
Optional
Return values:
The hexadecimal representation of the given string.
Value Type: String.
Pictorial Presentation
Example:
<?php
$string_name='w3resource.com';
echo bin2hex($string_name);
?>
Output:
77337265736f757263652e636f6d
View the example in the browser
See also
Previous: addcslashes
Next: chop
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics