DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

heinz has posted 2 posts at DZone. View Full User Profile

Hex2string

04.04.2006
| 2473 views |
  • submit to reddit
        // description of your code here

<?php
  function hex2string($hex)
  {
    $string = NULL;
    $hex = str_replace(array("\n","\r"), "", $hex);
    for ($i=0; $i < $strlen($hex);$i++) 
    {
      $string.= chr(hexdec(substr($hex, $i, 2)));
    }
    return $string;
  }
?>