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, ∼3579🔥, 0💬
Popular Posts:
How to pull NVIDIA CUDA Docker Image with the "docker image pull nvidia/cuda" command? If you are ru...
How to add a new operation to an API on the Publisher Dashboard of an Azure API Management Service? ...
What is the "__init__()" class method? The "__init__()" class method is a special method that will b...
How To Read the Entire File into a Single String in PHP? If you have a file, and you want to read th...
What are "*..." and "**..." Wildcard Parameters in Function Definitions? If you want to define a fun...