Tools, FAQ, Tutorials:
Converting Strings to Hex Numbers in PHP
How To Convert Strings to Hex Numbers?
✍: FYIcenter.com
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
⇒ Generating Character from ASCII Value in PHP
⇐ Comparing Two Strings with strcmp() in PHP
2016-10-13, ∼4274🔥, 0💬
Popular Posts:
How to use the "Ctrl-p Ctrl-q" sequence to detach console from the TTY terminal of container's runni...
How To Read a File in Binary Mode in PHP? If you have a file that stores binary data, like an execut...
How to use the "find-and-replace" Policy Statement for an Azure API service operation? The "find-and...
How To Access a Specific Character in a String? Any character in a string can be accessed by a speci...
How to include additional claims in Azure AD v2.0 id_tokens? If you want to include additional claim...