How to decode hex content?
<p>I have $_SERVER['REDIRECT_SSL_CLIENT_S_DN'] content that has somekind of hex data. How can i decode it?</p>

<pre><code>$_SERVER['REDIRECT_SSL_CLIENT_S_DN'] = '../CN=\x00M\x00\xC4\x00,\x00I\x00S\x00,\x004\x000\x003\x001\x002\x000\x000\x002/SN=..';
$pattern = '/CN=(.*)\\/SN=/';
preg_match($pattern, $_SERVER['REDIRECT_SSL_CLIENT_S_DN'], $server_matches);
print_r($server_matches[1]);
</code></pre>

<p>The result is: </p>

<p><code>\x00M\x00\xC4\x00,\x00I\x00S\x00,\x004\x000\x003\x001\x002\x000\x000\x002</code></p>

<p>The result i need is: </p>

<p><code>MÄ,IS,40312002</code></p>

<p>I tried to decode it with <code>chr(hexdec($value));</code> and it almost works, but in html input i see lot of question marks.</p>

<p><strong>EDIT:</strong>
Additional test with results. Not yet perfect. Array reveals some errors:  <a href="http://pastebin.com/BC4xxqmE" rel="nofollow">http://pastebin.com/BC4xxqmE</a></p>
