title: How to display special characters in PHP
body: <p>I've seen this asked several times, but not with a good resolution. I have the following string:</p>
  
  <pre><code>$string = "&lt;p&gt;Résumé&lt;/p&gt;";
  </code></pre>
  
  <p>I want to print or echo the string, but the output will return <code>&lt;p&gt;R�sum�&lt;/p&gt;</code>. So I try <code>htmlspecialchars()</code> or <code>htmlentities()</code> which outputs <code>&amp;lt;p&amp;gt;R&amp;eacute;sum&amp;eacute;&amp;lt;p&amp;gt;</code> and the browser renders <code>&amp;lt;p&amp;gt;R&amp;eacute;sum&amp;eacute;&amp;lt;p&amp;gt;</code>. I want it, obviously, to render this:</p>
  
  <blockquote>
    <p>Résumé</p>
  </blockquote>
  
  <p>And I'm using UTF-8:</p>
  
  <pre><code>header("Content-type: text/html; charset=UTF-8");
  </code></pre>
  
  <p>What am I missing here? Why do <code>echo</code> and <code>print</code> output a <code>�</code> for any special character? To clarify, the string is actually an entire HTML file stored in a database. The real-world application is not just that one small line.</p>