Posted By

dygor on 09/04/09


Tagged

String convert hexadecimal


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

umang_nine


Str To Hex / Hex To Str


 / Published in: PHP
 

convert a string to it's hex representation and back

  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  

You need to login to post a comment.