title: How to convert HTML entities like &#8211; to their character equivalents?
body: <p>I am creating a file that is to be saved on a local user's computer (not rendered in a web browser).</p>
  
  <p>I am currently using <code>html_entity_decode</code>, but this isn't converting characters like <code>&amp;#8211;</code> (which is the n-dash) and was wondering what other function I should be using.</p>
  
  <p>For example, when the file is imported into the software, instead of the ndash or just a - it shows up as <code>&amp;#8211;</code>. I know I could use <code>str_replace</code>, but if it's happening with this character, it could happen with many others since the data is dynamic.</p>