functions.php
changeset 74 7719085707d8
parent 69 73780a159e15
child 75 2f39cb7f54c4
equal deleted inserted replaced
73:1f55c324efcf 74:7719085707d8
   331       $GLOBALS[$var] = $$var;
   331       $GLOBALS[$var] = $$var;
   332     }
   332     }
   333   }
   333   }
   334 }
   334 }
   335 
   335 
       
   336 /**
       
   337  * Decodes a hex string.
       
   338  * @param string $hex The hex code to decode
       
   339  * @return string
       
   340  */
       
   341 
       
   342 function hexdecode($hex)
       
   343 {
       
   344   $hex = str_split($hex, 2);
       
   345   $bin_key = '';
       
   346   foreach($hex as $nibble)
       
   347   {
       
   348     $byte = chr(hexdec($nibble));
       
   349     $bin_key .= $byte;
       
   350   }
       
   351   return $bin_key;
       
   352 }
       
   353