|
|
Tutorials » Php »
|
Topic |
What is bin2hex() function?
|
|
Explanation |
|
The bin2hex() function is used to convert binary data to hexadecimal.
Syntax:
bin2hex(string)
In the above syntax the string is converted to hexadecimal numbers.
Example:
<?php
$s = "hello";
echo bin2hex($s)."<br/>";
?>
Result:
48656c6c6f
In the above example the string "hello" is converted to hexadecimal equivalent "48656c6c6f".
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|