title: cannot get html special chars from url
body: <p>I'm very new to php and can't find answer to my issue.</p>
  
  <p>I try to echo a string with special characters (ie. <code>&amp;agrave;</code>,<code>&amp;eacute;</code>) from the URL.</p>
  
  <p>URL string:
  <code>preview.php?content=&lt;p&gt;bl&amp;agrave; &amp;eacute; bla&lt;/p&gt;</code></p>
  
  <p>Expected echoed result: <code>blà é bla</code></p>
  
  <p>So I do this:</p>
  
  <pre><code>$cont = $_GET['content'];
  echo $cont;
  </code></pre>
  
  <p>Result:
      <code>bl</code></p>
  
  <p>So, even if my page has a <code>&lt;meta charset="UTF-8"&gt;</code>, I tried:</p>
  
  <pre><code>$cont = $_GET['content'];
  $cont = html_entity_decode($cont, ENT_COMPAT, 'UTF-8');
  echo $cont;
  </code></pre>
  
  <p>Same result:
      <code>bl</code></p>
  
  <p>I tried with a header (<code>header('Content-Type: text/html; charset=UTF-8');</code>) at top of the page with same result.</p>
  
  <p>What's weird is that is I try this:</p>
  
  <pre><code>echo html_entity_decode("&lt;p&gt;bl&amp;agrave; &amp;eacute; bla&lt;/p&gt;");
  </code></pre>
  
  <p>or even this:</p>
  
  <pre><code>echo "&lt;p&gt;bl&amp;agrave; &amp;eacute; bla&lt;/p&gt;";
  </code></pre>
  
  <p>I get the expected result:
      <code>blà é bla</code></p>
  
  <p>So, I don't think it's a charset issue but can't understand why it works with the literal string but not with the get variable, can someone help me?</p>