title: PHP - Convert hex character to HTML entity
body: <p>I'm using imagettftext to create images of certain text characters. To do this, I need to convert an array of hexidecimal character codes to their HTML equivalents and I can't seem to find any functionality built-in to PHP to do this. What am I missing? (through searching, I came across this: <a href="https://stackoverflow.com/questions/198007/php-function-imagettftext-and-unicode">PHP function imagettftext() and unicode</a>, but it none of the answers seem to do what I need - some characters convert but most don't).</p>
  
  <p>Here's the resulting HTML representation (in the browser)</p>
  
  <pre><code> [characters] =&gt; Array
      (
          [33] =&gt; A
          [34] =&gt; B
          [35] =&gt; C
          [36] =&gt; D
          [37] =&gt; E
          [38] =&gt; F
          [39] =&gt; G
          [40] =&gt; H
          [41] =&gt; I
          [42] =&gt; J
          [43] =&gt; K
          [44] =&gt; L
      )
  </code></pre>
  
  <p>Which comes from this array (not capable of rendering in imagettftext):</p>
  
  <pre><code> [characters] =&gt; Array
      (
          [33] =&gt; &amp;#x41
          [34] =&gt; &amp;#x42
          [35] =&gt; &amp;#x43
          [36] =&gt; &amp;#x44
          [37] =&gt; &amp;#x45
          [38] =&gt; &amp;#x46
          [39] =&gt; &amp;#x47
          [40] =&gt; &amp;#x48
          [41] =&gt; &amp;#x49
          [42] =&gt; &amp;#x4a
          [43] =&gt; &amp;#x4b
          [44] =&gt; &amp;#x4c
      )
  </code></pre>