title: PHP get hex value (not the string representation, actually hex)
body: <p>I have the hex representation and I'm trying to convert this to the type of hex. For example if you execute:</p>
  
  <pre><code>echo "\xFF\xAA";
  echo '&lt;br&gt;';
  $first    = "FF";
  $second   = "AA";
  echo "\x$first\x$second";
  die();
  </code></pre>
  
  <p>The result you get is:<br>
  <img src="https://i.stack.imgur.com/xR5sX.png" alt="code output"></p>
  
  <p>So the first line is weird symbols. This indicates to me this is actually of type hex. Where the second result although is valid representations of hex, they are in fact not actually hex.</p>
  
  <p>So my question is how can I make the actual result hex? I want to be able to use a variable as the representation but actually convert it to hex. (I want line two to show up as symbols)</p>