functions.php 309 B

12345678910111213141516
  1. <?php
  2. if (!function_exists('hex2bin')) {
  3. /**
  4. * If the PHP version being used is earlier than 5.4.0, we need to
  5. * make up for the lack of a hex2bin() function.
  6. */
  7. function hex2bin($data) {
  8. $bin = '';
  9. foreach (str_split($data, 2) as $pair) {
  10. $bin .= chr(hexdec($pair));
  11. }
  12. return $bin;
  13. }
  14. }