src/Kunstmaan/UtilitiesBundle/Helper/Cipher/UrlSafeCipher.php
public function hex2bin($hexString)
    {
        $pos = 0;
        $result = '';
        while ($pos < strlen($hexString)) {
            if (strpos(" \t\n\r", $hexString[$pos]) !== false) {
                ++$pos;
            } else {
                $code = hexdec(substr($hexString, $pos, 2));
                $pos += 2;
                $result .= chr($code);
            }
        }

        return $result;
    }
public function hex2bin($hexString)
    {
        $pos = 0;
        $result = '';
        while ($pos < strlen($hexString)) {
            if (strpos(" \t\n\r", $hexString[$pos]) !== false) {
                ++$pos;
            } else {
                $code = hexdec(substr($hexString, $pos, 2));
                $pos += 2;
                $result .= chr($code);
            }
        }

        return $result;
    }
public function hex2bin ( $ hexString ) { $ pos = 0 ; $ result = '' ; while ( $ pos < strlen ( $ hexString ) ) { if ( strpos ( " \t\n\r" , $ hexString [ $ pos ] ) !== false ) { ++ $ pos ; } else { $ code = hexdec ( substr ( $ hexString , $ pos , 2 ) ) ; $ pos += 2 ; $ result .= chr ( $ code ) ; } } return $ result ; }
Decodes a hexadecimal encoded binary string.
PHP version >= 5.4 has a function for this by default.

@param string $hexString

@return string
Decodes a hexadecimal encoded binary string . PHP version > = 5 . 4 has a function for this by default .