title: Encoding odd HTML entities '&lstroke;'
body: <p>I have problems with some odd HTML entities that comes from a XML file that I have to parse in PHP 5.6.</p>
  
  <p>Some of the HTML entities are: </p>
  
  <pre><code>&amp;lstroke;
  n&amp;acute;
  a&amp;hook;
  e&amp;hook;
  </code></pre>
  
  <p>The XML comes from CAB Abstracts (<a href="http://www.cabi.org/publishing-products/online-information-resources/cab-abstracts/" rel="nofollow">http://www.cabi.org/publishing-products/online-information-resources/cab-abstracts/</a>) and its header is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  </code></pre>
  
  <p>However, I have tried several encoding systems without success. Also, I have tried using them directly in HTML files, writing them from PHP 5.6 using html_entity_decode like this:</p>
  
  <pre><code>$strings = array('&amp;Sacute;wia&amp;hook;tek', 'Kie&amp;lstroke;kiewicz', 'Zagdan&amp;acute;ska', 'Mie&amp;hook;tkiewski');
  
  foreach ($strings as $s) {
      foreach (array(
              'ISO-8859-1', 'ISO-8859-5', 'ISO-8859-15', 'UTF-8',
              'cp866', 'cp1251', 'cp1252', 'KOI8-R', 'BIG5', 'GB2312',
              'BIG5-HKSCS', 'Shift_JIS', 'EUC-JP', 'MacRoman', '') as $l) {
          print $l . ' ==&gt; ';
          print html_entity_decode($s, ENT_COMPAT | ENT_QUOTES | ENT_XML1 | ENT_XHTML | ENT_HTML5, $l) . '&lt;br&gt;';
      }
  }
  </code></pre>
  
  <p>Nothing works!!</p>
  
  <p>I would like to avoid any kind of solution that include parsing the XML file replacing these entities by the right UTF-8 character. I can not foreseen when odd HTML entities like these will be included and the files are relatively big.</p>
  
  <p>The string should look like these:</p>
  
  <pre><code>Świątek
  Kiełkiewicz
  Zagdańska 
  Miętkiewski
  </code></pre>
  
  <p>So, the question is:</p>
  
  <p>How can I decode this odd HTML entities to UTF-8 in PHP?</p>