How to use bin2hex() function to convert an ASCII string to hexadecimal ASCII string in PHP

1 Answer

0 votes
echo bin2hex('a') . "<br />";
echo bin2hex('abc') . "<br />";
echo bin2hex('#Dennis Ritchie#') . "<br />";


/*
run:

61
616263
2344656e6e6973205269746368696523

*/

 



answered May 15, 2016 by avibootz
edited Mar 16, 2019 by avibootz

Related questions

...