Posted By

etangle on 01/23/10


Tagged

hex String


Versions (?)

Converting hex to string


 / Published in: PHP
 

URL: http://ditio.net/2008/11/04/php-string-to-hex-and-hex-to-string-functions/

  1. function hexToStr($hex)
  2. {
  3. $string='';
  4. for ($i=0; $i < strlen($hex)-1; $i+=2)
  5. {
  6. $string .= chr(hexdec($hex[$i].$hex[$i+1]));
  7. }
  8. return $string;
  9. }

Report this snippet  

You need to login to post a comment.