Converting hex to string


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



Copy this code and paste it in your HTML
  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. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.