Str To Hex / Hex To Str


/ Published in: PHP
Save to your folder(s)

convert a string to it's hex representation and back


Copy this code and paste it in your HTML
  1. function string_to_hex($input)
  2. {
  3. return(bin2hex($input));
  4. }
  5.  
  6.  
  7. function hex_to_string($input)
  8. {
  9. return(pack("H*",$input));
  10. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.