1.

How To Convert Strings In Hex Format?

Answer»

If you want convert a STRING into hex FORMAT, you can use the bin2hex() function. Here is a PHP script on how to use bin2hex():
<?php
$string = "Hello\tworld!\n";
PRINT($string."\n");
print(bin2hex($string)."\n");
?>
This script will print:
Hello world!
48656c6c6f09776f726c64210a

If you want convert a string into hex format, you can use the bin2hex() function. Here is a PHP script on how to use bin2hex():
<?php
$string = "Hello\tworld!\n";
print($string."\n");
print(bin2hex($string)."\n");
?>
This script will print:
Hello world!
48656c6c6f09776f726c64210a



Discussion

No Comment Found